2017-10-02 22 views
8

Mỗi khi tôi kéo để làm mới TableView, UIRefreshControl dường như bị trục trặc. Dưới đây là mã tôi đang sử dụng. Bất kỳ ý tưởng?UIRefreshControl() trong iOS 11 Hiệu ứng Glitchy

Trong appdelegate:

UINavigationBar.appearance().isTranslucent = false 
UINavigationBar.appearance().barTintColor = UIColor.red 
UINavigationBar.appearance().tintColor = UIColor.white 

Trong UITableViewController:

self.tableView.refreshControl = UIRefreshControl() 

if #available(iOS 11.0, *) { 
    self.navigationController?.navigationBar.prefersLargeTitles = false 
} else { 
    // Fallback on earlier versions 
} 

self.tableView.refreshControl = refreshCont 
+5

nếu chúng tôi gặp vấn đề tương tự, tôi đã sửa lỗi bằng cách đặt self.extendedLayoutIncludesOpaqueBars = YES, đừng hỏi tôi tại sao – hhanesand

+1

@hhanesand Cảm ơn! – Arco

Trả lời

7

Đối với tôi self.extendedLayoutIncludesOpaqueBars = YES cố định vấn đề này.

0

Có thể là do bộ điều khiển của bạn là UIViewController với bảngView được nhúng. Nó phải là một UITableViewController.

Xem câu trả lời này trên https://stackoverflow.com/a/45305918/5965126. Nó đã lưu ngày của tôi

Các vấn đề liên quan