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]];