if(@available(iOS 11.0, *)){
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}else{
self.automaticallyAdjustsScrollViewInsets = NO;
}
self.edgesForExtendedLayout = UIRectEdgeNone;
self.edgesForExtendedLayout = UIRectEdgeNone;
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//里面可不写代码
}
本文介绍了在iOS11及以上版本中如何调整UITableView的布局,通过设置contentInsetAdjustmentBehavior和automaticallyAdjustsScrollViewInsets属性来确保应用在不同iOS版本上的适配。同时,文章还展示了如何使用edgesForExtendedLayout属性防止布局延伸。
146

被折叠的 条评论
为什么被折叠?



