1. 程式人生 > >iOS 11 安全區域適配

iOS 11 安全區域適配

table blog header color ntb safe ios 方法 pear

//解決iOS11,僅實現heightForHeaderInSection,沒有實現viewForHeaderInSection方法時,section間距大的問題

[UITableView appearance].estimatedRowHeight = 0;
[UITableView appearance].estimatedSectionHeaderHeight = 0;
[UITableView appearance].estimatedSectionFooterHeight = 0;



//iOS11 解決SafeArea的問題,同時能解決pop時上級頁面scrollView抖動的問題

if
(@available(iOS 11, *)) { [UIScrollView appearance].contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; //iOS11 解決SafeArea的問題,同時能解決pop時上級頁面scrollView抖動的問題 }

iOS 11 安全區域適配