【发布时间】:2018-10-27 05:41:57
【问题描述】:
我正在使用 pull 来刷新 tableview 上的常规数据刷新。
这是我的代码
-(void)addUIRefreshControl{
//Instantiate and Configure Refresh Control
self.refreshControl = [[UIRefreshControl alloc] init]; // initialize refresh control
self.refreshControl.tintColor = [UIColor appBaseColor]; // set tint color
[self.refreshControl addTarget:self
action:@selector(refreshAPI)
forControlEvents:UIControlEventValueChanged]; // add target
[self.tableView addSubview:self.refreshControl]; // add the refresh control
}
-(void)refreshAPI{
if ([APP_DELEGATE isNetAvailable]) {
[self fetchAPI];
}else{
if (self.refreshControl) {
[self.refreshControl endRefreshing]; //end refreshing
}
}
}
在 iOS 设备和模拟器上一切正常,除了 iPhone X。谁能指出我做错了什么?
谢谢
【问题讨论】:
-
将 refreshcontrol 移动到 viewDidAppear 中的 superview
标签: objective-c iphone pull-to-refresh iphone-x uirefreshcontrol