iOS 7导航栏颜色在iPhone 4上无法正常显示 [英] iOS 7 navbar colours not showing properly on iPhone 4

查看:127
本文介绍了iOS 7导航栏颜色在iPhone 4上无法正常显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的导航栏颜色通常在iOS 7中显示

My navigation bar colours appear normally in iOS 7

部署iOS 6.0,但如果系统版本是iOS 7.0或更高版本,则某些导航栏着色不会在iPhone 4上正常显示。在iPhone 5中正常工作。

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.

以下是我的工作方式:

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)

可能最后一行是问题(setTranslucent),因为我听说iPhone 4在半透明方面存在一些问题,但我是非常确定你可以在iOS 6中将导航栏设置为半透明。将尝试摆脱下一个并更新,如果它修复任何东西。

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.

编辑:
看起来我解雇一个呈现的视图控制器后条形颜色消失。但除了iPhone 4之外,它并没有搞砸任何东西。

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.

推荐答案

摆脱[self.navigationController.navigationBar setTranslucent:是];

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

如果需要,可以检查设备型号
(参见此处:使用iPhone SDK确定设备(iPhone,iPod Touch)

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

并相应地调整视图。

这篇关于iOS 7导航栏颜色在iPhone 4上无法正常显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆