Iphone 设置UINavigationBar tintColor仅将其设置为';s后退按钮颜色
因此,我正在设置UINavigationBar tintColor,下面是我得到的:Iphone 设置UINavigationBar tintColor仅将其设置为';s后退按钮颜色,iphone,objective-c,ipad,uinavigationcontroller,uinavigationbar,Iphone,Objective C,Ipad,Uinavigationcontroller,Uinavigationbar,因此,我正在设置UINavigationBar tintColor,下面是我得到的: [navController.navigationBar setTintColor:[UIColor whiteColor]]; 这怎么可能呢?如果有帮助,这里有更多信息: 我有一个UINavigationController,我定制如下: 首先,拿出一个44像素高的图像作为导航条的背景。(在这种情况下,如果你想使用44像素高的白色图像,那就可以了——但如果你使用某种垂直梯度,效果会更好) 其次,在AppD
[navController.navigationBar setTintColor:[UIColor whiteColor]];
这怎么可能呢?如果有帮助,这里有更多信息:
我有一个
UINavigationController
,我定制如下:
首先,拿出一个44像素高的图像作为导航条的背景。(在这种情况下,如果你想使用44像素高的白色图像,那就可以了——但如果你使用某种垂直梯度,效果会更好)
其次,在AppDelegate
的didfishLaunching
方法中使用以下代码。(图像名为“background\u 44.png
”
我在我的项目中删除了该代码,效果很好。甚至更改了条形图的样式和颜色。没问题。这行代码很好,在其他地方出现了问题或出现了一些疯狂的故障。或者您可以查看此相关问题:
// Set the background image for *all* UINavigationBars
UIImage *gradientImage44 = [[UIImage imageNamed:@"background_44.png"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set the background image for *all* UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:gradientImage44
forBarMetrics:UIBarMetricsDefault];