I am making an app in which I created custom navigation bar - MyNavigationBar (extends UIView):
MyNavigationBar.xib :
MyNavigationBar.m :
+(id)navigationBar{
MyNavigationBar * bar = (MyNavigationBar *) [[[NSBundle mainBundle] loadNibNamed:@"MyNavigationBar" owner:self options:nil] objectAtIndex:0];
return bar;
}
Then in NavigationViewController implementation I use this code to add view showed above to navigationBar:
NavigationViewController.m:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
_navBar = [MyNavigationBar navigationBar];
[self.navigationBar addSubview:_navBar];
}
return self;
}
When the left button (subview of MyNavigationBar) is pressed
[[self navigationController] popViewControllerAnimated:YES];
is called.
And the problem is that on that pop animation glitch happens, it looks like this:
Back button become visible for all animation duration and then disappears.
I have tried this but nothing happens:
[_navigationBar.backItem setHidesBackButton:YES];