在多人開發協作時,在appdelegate中,設置了navigationBar的barTintColor
navigationBar.barTintColor = [UIColor colorWithPatternImage:[[UIImage imageNamed:@"navigatorBar_bg"] scaleToSize:CGSizeMake(ScreenWidth, 1)]];
navigationBar.translucent = NO;
在iOS11之前版本沒有問題statusBar顏色會和navigationBar顏色保持一致,
在升級xcode9.2之后,在系統為iOS11的手機上運行,發現下方有輸入框的界面,在輸入框彈出隱藏幾次之后,statusBar的顏色會變回白色,搜索之后并沒有發現問題的根源,所以就用了一個簡單粗暴的辦法,在這個界面重新單獨設置statusBar的顏色,
- (void)setStatusBarBackgroundColor:(UIColor *)color {
???
??? UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"];
???
??? if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) {
???????
??????? statusBar.backgroundColor = color;
??? }
}
設置之后statusBar在鍵盤彈出隱藏時顏色不變。
若各位知曉問題原因或者有更好的解決辦法,請告知,謝謝。
其余在此項目中遇到問題:
iOS NSMutableArray使用addObject:方法時數據被覆蓋