简体   繁体   中英

ios7 navigationbar left UIBarButtonItem issue

I am updating my big project to ios7 . And When I update left navigation button have problem . I don't understand What is problem .

ios6: left button image haven't problem :

在此处输入图片说明

ios7: left button have problem

在此处输入图片说明

Also when I go next viewcontroller back button have same problem in ios7:

在此处输入图片说明

I am using for menu this image: link . image is transparent .

How can I solve this problem in ios7 . it's big project and ı can't share all code.When I read article , article says it's problem is setTintColor. right ?

sorry my English.

Thank you .

I changed global tint and I use this way to keep my UIBarButtonItem normal.

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

what is the color for your image used in the left top navigational bar button? you can try to change the following.

  1. Give the bar button item tint = clear color
  2. Give the button item tint under the bar button item as Default and its background as clear color.
  3. change Alpha Value of button item to 1.

I solved the problem .I added to viewDidLoad method

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM