0

我正在更新我的大項目到ios7。而當我更新左側導航按鈕有問題。 我不明白什麼是問題。ios7 navigationbar left UIBarButtonItem問題

iOS6的:左邊的按鈕圖像都沒有問題:

enter image description here

ios7:左邊的按鈕有問題

enter image description here

此外,當我去旁邊的ViewController後退按鈕有同樣的問題ios7:

enter image description here

我使用此圖像的菜單:link。圖像是透明的。

我該如何解決ios7中的這個問題。 它是大項目和ı不能共享所有代碼。當我閱讀文章時,文章說它的問題是setTintColor。對 ?

對不起我的英文。

謝謝。

+0

[iOS的7 UIBarButton後退按鈕箭頭顏色(http://stackoverflow.com/a/18487559/593709),你需要創建的UIButton與圖像(這樣的形象),並把它添加到的UIBarButtonItem –

+0

。在僅顯示此類的ios7 UIButton和barbutton中,它是默認值。 – karthika

+0

@AdilSoomro我嘗試之前,但它不工作。 –

回答

0

我解決了。我加入到viewDidLoad方法問題

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) 
{ 
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]]; 
} 
else 
{ 
    [self.navigationController.navigationBar setTintColor:[UIColor colorWithRed:.694 green:.164 blue:.105 alpha:1.0f]]; 
} 
0

左上方導航欄按鈕中使用的圖像顏色是什麼?您可以嘗試更改以下內容。

  1. 給杆按鈕項色調=清晰的彩色
  2. 給杆按鈕項下的按鈕項色調爲默認及其背景爲透明的顏色。
  3. 變化按鈕項的Alpha值1
+0

我編輯過的問題。你可以看到我的形象。圖像是透明的 –

+0

做了我在我的答案寫的方法沒有工作? – azmuhak

+1

我也想支持ios7的早期版本。它不適合我,我解決了它。我會分享我的答案 –

1

我改變了全球的色調,我用這種方式來保持我正常的UIBarButtonItem。

#define kColorGlobalTint [UIColor redColor] 
UIColor *defaultColor = [UIView appearanceWhenContainedIn:[UINavigationBar class], nil].tintColor; 
[[UIView appearance] setTintColor:kColorGlobalTint]; 
[[UIView appearanceWhenContainedIn:[UINavigationBar class], nil] setTintColor:defaultColor]; 

[[UINavigationBar appearance] setBarTintColor:kColorGlobalTint]; 
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];