1.適配TableView
在AppDelegate配置一次即可,方法如下
- (void)adaptationAfterIOS11UI {
if (@available(iOS 11.0, *)) {
[UITableView appearance].estimatedRowHeight = 0;
[UITableView appearance].estimatedSectionFooterHeight = 0;
[UITableView appearance].estimatedSectionHeaderHeight = 0;
}
}
2.頁面有時(shí)上部會(huì)留白
可以設(shè)置automaticallyAdjustsScrollViewInsets為 NO;
iOS11之后使用 Use UIScrollView's contentInsetAdjustmentBehavior instead
3.UISearchBar高度適配
SearchBar在Navi的titleView中,高度發(fā)生變化
解決辦法:自定義View,重寫系統(tǒng)方法,賦值給titleview。如下:
- (CGSize)intrinsicContentSize {
if (@available(iOS 11.0, *)) {
return UILayoutFittingCompressedSize;
}
return CGSizeZero;
}
note: 以后會(huì)繼續(xù)補(bǔ)充的??