适配iOS 11TableView

作者: 一笔春秋 | 来源:发表于2017-11-16 18:31 被阅读16次

1、自动调节关闭

if(@available(iOS11.0, *)) {

self.tableView.contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;

}else{

self.automaticallyAdjustsScrollViewInsets=NO;

}

2、Header和Footer界面调整。

Self-Sizing在iOS11下是默认开启的,Headers, footers, and cells都默认开启Self-Sizing,所有estimated 高度默认值从iOS11之前的 0 改变为UITableViewAutomaticDimension:

如果有动画监听,group模式下多于1屏显示,都会引起错位

关闭Self-Sizing:

self.tableView.estimatedRowHeight=0;

self.tableView.estimatedSectionHeaderHeight=0;

self.tableView.estimatedSectionFooterHeight=0;

相关文章

网友评论

    本文标题:适配iOS 11TableView

    本文链接:https://www.haomeiwen.com/subject/zplrvxtx.html