Tôi đang cố gắng triển khai chức năng kéo để làm mới trong ứng dụng của mình. Kiến trúc là như vậy mà có một UITableView
bên trong một UIViewController
. Tôi muốn có thể làm mới chế độ xem bảng khi kéo xuống. Tôi đã thử các mã dưới đây trong phương pháp viewDidLoad
, nhưng nó không hoạt động. Bất kỳ ai có thể cho tôi biết tôi đang sai khi triển khai không?Kéo để làm mới trên UITableView Bên trong một UIViewController
UIRefreshControl *refresh = [[UIRefreshControl alloc] init];
refresh.tintColor = [UIColor grayColor];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(get_vrns) forControlEvents:UIControlEventValueChanged];
[self.vrnTable addSubview:refresh];
thể trùng lặp của [UIRefreshControl mà không UITableViewController] (http://stackoverflow.com/questions/12497940/uirefreshcontrol-without-uitableviewcontroller) – Amar
có thể trùng lặp của [Kéo để làm mới UITableView mà không có UITableViewController] (http://stackoverflow.com/questions/10291537/pull-to-re fresh-uitableview-without-uitableviewcontroller) – Lanorkin