UIRefreshControl色调颜色与给定颜色不匹配
刷新颜色与色调颜色不匹配,看起来不同,我试图改变tintAdjustmentMode,但结果是一样的
需要注意的是,微调器和文本颜色应为0x2C76BE
tvc.refreshControl = [UIRefreshControl new]; tvc.refreshControl.tintAdjustmentMode = UIViewTintAdjustmentModeNormal; tvc.refreshControl.tintColor = [UIColor colorWithHex:0x2C76BE]; tvc.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to query spectrum again" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0x2C76BE]}];
UIRefreshControl是一个错误的类。 我注意到放置了tvc.refreshControl.tintColor = [UIColor colorWithHex:0x2C76BE];
在动画块内(即使是零持续时间)也会产生预期的结果。 所以我测试了这个可怕的’hack’: dispatch_async(mainQueue, <#set tintColor#>);
这也给出了正确的结果。 可能还存在refreshcontrol对调用-beginRefreshing
或-endRefreshing
的时间的-endRefreshing
。
因为UIRefreshControl的错误以及只能在UITableViewController中使用的限制让我非常恼火,所以我创建了一个完全可自定义的,可用于任何类型的UIScrollView(UICollectionView,UITableView)。 请注意,我在UICollectionViewFlowLayout支持像tableView这样的粘性标头之前创建了这个,所以当启用该选项时,我的refreshcontrol不能正常工作。 随意提交修复;)。
你可以在这里找到它https://github.com/Joride/JRTRefreshControl (如果这属于’无耻的插入条款’我将删除此链接,但我认为它与问题相关。