1.在iOS11系統(tǒng)上跑不起來項(xiàng)目,log輸出nw_proxy_resolver_create_parsed_array PAC evaluation error: NSURLErrorDomain: -1004
這是因?yàn)樵贛ac系統(tǒng)中設(shè)置了網(wǎng)絡(luò)自動代理而導(dǎo)致
解決方案:系統(tǒng)偏好設(shè)置 → 網(wǎng)絡(luò) → 高級 → 代理 → 取消自動代理配置
2.在iphone X上崩潰.Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIStatusBar_Modern 0x7fc1f0c11700> valueForUndefinedKey:]: this class is not key value coding-compliant for the key foregroundView.'
原來版本的友盟plus有問題,更新就好了,(如果不行,就是因?yàn)閯e的問題導(dǎo)致此崩潰)
3.Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 1708, TID: 268523, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
警告是因?yàn)樵拘枰谥骶€程執(zhí)行的代碼被放在了子線程里邊,shareSDK 中把狀態(tài)欄設(shè)置在子線程,所以輸出此警告,可以在scheme 里邊取消主線程檢測(如圖),不過不建議如此
4.在我們自己封裝tabbarController,并且重新封裝tabbar的時(shí)候,不要用
self.viewControllers = navLists;
這種寫法, 在iOS11上會出現(xiàn)不默認(rèn)選中tabbarItem的BUG.
使用
[self addChildViewController:nav];
這種寫法即可
5.iOS11系統(tǒng)上有時(shí)tableView會下移20個(gè)像素點(diǎn),使用contentInsetAdjustmentBehavior代替automaticallyAdjustsScrollViewInsets.
//如果是iOS11的系統(tǒng), 則不自動調(diào)整內(nèi)邊距
if (@available(iOS 11.0, *))
{
if ([self.tableView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
在iphoneX上頭部和尾部空出一部分.
只要添加一個(gè)iPhoneX尺寸的啟動圖就可以了.iPhoneX對應(yīng)像素 1125 * 2436在iOS11上,有時(shí)候使用上啦加載更多,會遇到刷新之后,頁面閃動到別的位置,比如cell上移,或者cell下移了.關(guān)掉iOS11的Self-Sizing(iOS 11默認(rèn)開啟).
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedRowHeight = 0;
注意要加上if (@available(iOS 11.0, *)),如
if (@available(iOS 11.0, *))
{
self.tableView.estimatedSectionHeaderHeight = 0;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedRowHeight = 0;
}
//參考文章