fun*_*len 13 ios uirefreshcontrol pull-to-refresh ios11
根据Apple的说法,刷新控件应该是iOS 11中大标题导航栏的一部分.
当我在故事板中为UITableViewController启用刷新控件时,刷新控件是导航栏的一部分(在拉动刷新时).
我不能在故事板中为所有其他视图(如UICollectionViewController)执行此操作.当我在代码中添加刷新控件作为子视图时,它不是导航栏的一部分:
refreshControl = UIRefreshControl()
collectionView?.addSubview(refreshControl)
Run Code Online (Sandbox Code Playgroud)
它看起来像这样:
如何在我的自定义滚动视图(如UICollectionViewController)中添加刷新控件,以便在使用大标题时导航栏中显示刷新控件?
Mar*_*tin 53
从iOS 10开始,UITableView
并UICollectionView
拥有refreshControl
属性.
所以,而不是:
tableView.addSubview(refreshControl)
你做:
tableView.refreshControl = refreshControl
这应该适用于iOS 11中的新大标题.
归档时间: |
|
查看次数: |
8659 次 |
最近记录: |