Reputation: 4517
In iOS 7 Apple introduced new transition when you push view controller on top of another view controller. The transition comes with nice animation and back gesture. The back button displays the title from previous view controller which is good for accessibility:
Unfortunately, our design require to remove navigation bar label because sometimes it is too long and it move navigation bar title to the right a little.
Here is how our design should look and work during the transition:
We removed the title from the first view controller in viewDidLoad
of the first view controller (the one which is behind):
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
Now our transition has status bar background color problem:
Status bar change background color to grey during transition. Both view controllers have white status bar background.
Pushing second view controller:
SecondVC *svc = [sb instantiateInitialViewController];
[self.navigationController svc animated:YES];`
Upvotes: 0
Views: 488
Reputation: 1778
In first ViewController -
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
UIBarButtonItem *btn=[[UIBarButtonItem alloc]initWithTitle:@"" style:UIBarButtonItemStylePlain target:self action:nil];
self.navigationItem.backBarButtonItem=btn;
}
Upvotes: 0
Reputation: 4517
The solution is to remove this line from our code:
[[UINavigationBar appearance] setBackgroundColor:Colour_White];
Upvotes: 0