iOS 7 navbar colours not showing properly on iPhone 4

[亡魂溺海] 提交于 2019-12-23 13:21:00

问题


My navigation bar colours appear normally in iOS 7

Deploying iOS 6.0, but if the system version is iOS 7.0 or later, some of the navigation bar colouring doesn't display properly on iPhone 4. Works fine in iPhone 5.

Here's how I am doing it:

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
    [self.navigationController.navigationBar setBarTintColor:[UIColor blueColor]];
    [self.navigationController.navigationBar setTranslucent:YES];
}


#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

Maybe the last line is the problem (setTranslucent) since I have heard that iPhone 4 has some problems with the translucency, but I'm pretty sure that you could set the navbar to be translucent in iOS 6 as well. Will try getting rid of that out next and update if it fixes anything.

EDIT: Looks like the bar colour disappears after I dismiss a presented view controller. But it doesn't screw up on anything but the iPhone 4.


回答1:


Get rid of [self.navigationController.navigationBar setTranslucent:YES]; and it should work fine.

If you want, you can check the device model (see here: Determine device (iPhone, iPod Touch) with iPhone SDK)

and adjust view accordingly.



来源:https://stackoverflow.com/questions/18990283/ios-7-navbar-colours-not-showing-properly-on-iphone-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!