1、在iOS 11中,會默認開啟獲取的一個估算值來獲取一個大體的空間大小,導致不能正常顯示,可以選擇關閉。目前嘗試在delegate中處理不能很好的解決,不過可以直接設置:
Swift
if #available(iOS 11.0, *) {
self.tabView.estimatedSectionHeaderHeight = 0.01
self.tabView.estimatedSectionFooterHeight = 0.01
}
OC
if (@available(iOS 11.0, *)) {
self.tableView.estimatedSectionHeaderHeight = 0.01;
self.tableView.estimatedSectionFooterHeight = 0.01;
}
2、啟動頁尺寸不對
刪除原來的LauchImage文件夾,然后添加iOS 11+的啟動圖片(圖片尺寸:1125 * 2436 )
3、在iOS11導航欄多了一個LargeTitleView,專門顯示大字標題用的,整個導航欄的高度達到了96p,比之前的導航欄多了32p,不過,大字標題默認是關閉的,所以一般情況下,導航欄的高度還是64p。
if #available(iOS 11.0, *) {
self.tabView.contentInsetAdjustmentBehavior = .never
} else {
self.automaticallyAdjustsScrollViewInsets = false
}
對于之前導航欄高度直接寫成64的地方做以下替換
let kStatusHeight = UIApplication.shared.statusBarFrame.size.height
let navHeight: CGFloat = self.navigationController!.navigationBar.frame.size.height
let kNavHeight: CGFloat = kStatusHeight + navHeight
let navView : GradientNavView = GradientNavView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: kNavHeight))
4、iOS11 中 "MBProgressHUD+NJ"不顯示彈框
將原本的
if (view == nil) {
view = [[UIApplication sharedApplication].windows lastObject];
}
改成
if (view == nil) {
view = [UIApplication sharedApplication].keyWindow;
}
5、無線模擬測試
配置好后截圖.png
6、iOS11下,如果沒有設置estimateRowHeight的值,也沒有設置rowHeight的值,那contentSize計算初始值是 44
隨后會不定期更新喲。。。