I have an iOS project with UINavigationController.
When I pushviewcontroller with
animated = YES
[self.navigationController pushViewController:viewController animated:YES];
the top leftbarbuttonitem (with image) is well positioned.
But if I set pushviewcontroller with
animated = NO
[self.navigationController pushViewController:viewController animated:NO];
the top leftbarbuttonitem (with image) is not positioned exactly the same place with previous one. Does anyone have any idea?
SAMPLE CODE
- (void)addBackButtonWithoutAnimation {
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
UIImage *closeImage = [UIImage imageNamed:@"icon_back"];
UIBarButtonItem *closeBackButton = [[UIBarButtonItem alloc] initWithImage:closeImage style:UIBarButtonItemStylePlain target:self action:@selector(closeBackButtonwithoutAnimationDidClick)];
self.navigationItem.leftBarButtonItem = closeBackButton;
self.navigationItem.hidesBackButton = YES;}
addBackButtonWithoutAnimationright?