I encountered a strange problem on the rightBarButtonItem
of UINavigationController
. The margin of the button disappears on iOS7
, so it looks like this:
At first, I thought it was some mistakes in my UINavigationController
related categories, but I removed all my customisation code and all the header files of categories, and simply use a UINavigationController and an empty view controller.
In - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
VCTestViewController *vc = [[[VCTestViewController alloc]init]autorelease];
UINavigationController *nc = [[[UINavigationController alloc]initWithRootViewController:vc]autorelease];
self.window.rootViewController = nc;
[self.window makeKeyAndVisible];
In VCTestViewController.m -> viewDidLoad
self.view.backgroundColor = [UIColor whiteColor];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"hello" style:UIBarButtonItemStyleBordered target:nil action:nil];
The problem still exists(as shown above). I can't figure out what is wrong. Do you have any idea about this problem?