YAPTR™: 另一个下拉刷新
contentInset
的滚动视图时通常无法正确工作,这对于我来说是需要的功能。天啊,连苹果自己的████████都无法尊重这个属性(但即便如此,它仍然是β版本)。UIControl
之上。触发时,向目标发送UIControlEventValueChanged
事件。向滚动视图添加刷新控件
PHFRefreshControl *refreshControl = [PHFRefreshControl new];
[refreshControl setTintColor:tintColor];
[refreshControl addTarget:dataController
action:@selector(reload)
forControlEvents:UIControlEventValueChanged];
[scrollView setRefreshControl:refreshControl];
程序化触发刷新
[[scrollView refreshControl] beginRefresh];
work();
[[scrollView refreshControl] endRefresh];
PHFDelegateChain
采用MIT许可证发布。
Philipe Fatio (@fphilipe)
箭头绘制代码改编自Sam Vermette的SVPullToRefresh。