iOS11弃用了automaticallyAdjustsScrollViewInsets属性,新增contentInsetAdjustmentBehavior来替代它,不想系统帮我们自动设置边距则要在iOS11中加上这句 scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
Activity
csdwd commentedon Sep 20, 2017
Very good!👍
csdwd commentedon Sep 20, 2017
if #available(iOS 11.0, *) { collectionView.contentInsetAdjustmentBehavior = .never } else { // Fallback on earlier versions }
swift中添加改行代码
xd54622 commentedon Sep 22, 2017
这样改的话,导航栏就要挡住tableview了。而设置contentInset的话,虽然可以解决遮挡问题,但是iPhone X的导航栏高度又不一样,又要根据机型来设置不同的contenInset,感觉不是很合理。
Rogue24 commentedon Sep 22, 2017
iPhoneX 就是苹果告诉我们状态栏和tabbar高度不要写死,要动态获取
SanlinBlackball commentedon Sep 25, 2017
那是不是不能设置tableView为self.view.bounds
Rogue24 commentedon Sep 25, 2017
可以,但是contentInset要设置正确
CoderMJLee commentedon Sep 27, 2017
@Rogue24 谢谢你的热心。
我也尝试让MJRefresh兼容iOS11了,大家可以试试版本3.1.13。近几个月身体抱恙,所以未及时更新,Sorry
Rogue24 commentedon Sep 27, 2017