1.在iOS11系統上跑不起來項目,log輸出nw_proxy_resolver_create_parsed_array PAC evaluation error: NSURLErrorDomain: -1004
這是因為在Mac系統中設置了網絡自動代理而導致
解決方案:系統偏好設置 → 網絡 → 高級 → 代理 → 取消自動代理配置
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有問題,更新就好了,(如果不行,就是因為別的問題導致此崩潰)
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:
警告是因為原本需要在主線程執行的代碼被放在了子線程里邊,shareSDK 中把狀態欄設置在子線程,所以輸出此警告,可以在scheme 里邊取消主線程檢測(如圖),不過不建議如此
4.在我們自己封裝tabbarController,并且重新封裝tabbar的時候,不要用
self.viewControllers = navLists;
這種寫法, 在iOS11上會出現不默認選中tabbarItem的BUG.
使用
[self addChildViewController:nav];
這種寫法即可
5.iOS11系統上有時tableView會下移20個像素點,使用contentInsetAdjustmentBehavior代替automaticallyAdjustsScrollViewInsets.
//如果是iOS11的系統, 則不自動調整內邊距
if (@available(iOS 11.0, *))
{
if ([self.tableView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
}
在iphoneX上頭部和尾部空出一部分.
只要添加一個iPhoneX尺寸的啟動圖就可以了.iPhoneX對應像素 1125 * 2436在iOS11上,有時候使用上啦加載更多,會遇到刷新之后,頁面閃動到別的位置,比如cell上移,或者cell下移了.關掉iOS11的Self-Sizing(iOS 11默認開啟).
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;
}
//參考文章