1. 程式人生 > >iOS 隱藏導航欄後,UITableView向下偏移狀態列高度 筆記

iOS 隱藏導航欄後,UITableView向下偏移狀態列高度 筆記

解決辦法

if (@available(iOS 11.0, *)) {
    self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
    self.automaticallyAdjustsScrollViewInsets = NO;
}

參考

一款輕量級的自動佈局框架