,所以我設置UINavigationBar的tintColor和這裏就是我得到:設置UINavigationBar的tintColor只設置它的背部按鈕顏色
[navController.navigationBar setTintColor:[UIColor whiteColor]];
這怎麼可能?這裏有一些更多的信息,如果有幫助:
,所以我設置UINavigationBar的tintColor和這裏就是我得到:設置UINavigationBar的tintColor只設置它的背部按鈕顏色
[navController.navigationBar setTintColor:[UIColor whiteColor]];
這怎麼可能?這裏有一些更多的信息,如果有幫助:
我有一個UINavigationController
,我自定義如下:
首先,拿出一個44px高的圖像作爲背景的導航欄。 (在這種情況下,如果你想使用一個44px高的白色圖像,即會做的伎倆---但它會看起來更漂亮,如果你使用某種類型的垂直梯度)
其次,使用以下代碼在您的AppDelegate
的didFinishLaunching
方法中。 (圖像被稱爲「background_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];
我丟棄的代碼在我的項目,工作得很好。甚至改變了酒吧的款式和顏色。沒問題,這行代碼是好的,有其他地方的問題。或它的一些瘋狂的毛刺
或者你可以檢查出此相關的問題:http://stackoverflow.com/questions/2706584/why-cant-i-set-a-custom-color-tint-for-the- UINavigationBar的 – bryanjclark 2012-02-07 23:27:20
不將其設置爲自定義顏色,它設置爲白色 – adit 2012-02-08 00:04:53