Pet*_*isu 29 cocoa-touch uitableview uirefreshcontrol ios7
第一次启动UIRefreshControl时文本被错误地反映...稍后有时刷新文本根本没有出现,只有刺状是可见的
我不认为我对iOS6有这个问题...可能与iOS7有关
在UITableViewController中作为子项添加到VC中,它驻留在一个模态呈现的UINavigationController中
- (void)viewDidLoad {
[super viewDidLoad];
[self setRefreshControlText:@"Getting registration data"];
[self.refreshControl beginRefreshing];
}
- (void)setRefreshControlText:(NSString *)text {
UIFont * font = [UIFont fontWithName:@"Helvetica-Light" size:10.0];
NSDictionary *attributes = @{NSFontAttributeName:font, NSForegroundColorAttributeName : [UIColor blackColor]};
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:text attributes:attributes];
}
Run Code Online (Sandbox Code Playgroud)


Ben*_*son 39
这绝对是一个iOS 7的bug,但我还没弄清楚究竟是什么导致了它.它似乎与视图层次结构有关 - 将我的UITableViewController作为子视图添加到包装器视图控制器似乎最初为我修复它,尽管自iOS 7 GM以来该错误已经回来了.
在创建刷新视图后,将以下代码添加到UITableViewController似乎可以解决定位问题:
Run Code Online (Sandbox Code Playgroud)dispatch_async(dispatch_get_main_queue(), ^{ [self.refreshControl beginRefreshing]; [self.refreshControl endRefreshing]; });
| 归档时间: |
|
| 查看次数: |
9969 次 |
| 最近记录: |