I'm trying to push from one VC to another - which is 0 problem, but VC1 has a orange NavigationBar while VC2 has a completely transparent NavigationBar. I would like to transition smoothly between the 2 different NavigationBars during the push segue. However, at the moment - it comes this blackish sliding bar and the color isn't transitioning nicely. This is my code:
VC1 viewWillAppear:
// Set the BarTintColor to translucent and text colors to white
[UIView animateWithDuration:0.5 animations:^{
self.navigationController.navigationBar.barTintColor = [UIColor orangeColor];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
}];
VC 2 viewWillAppear:
// Make the NavigationBar transparent
[UIView animateWithDuration:0.5 animations:^{
self.navigationController.navigationBar.backgroundColor = [UIColor clearColor];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
}];
How can I solve this in a more efficient and better way?
Thanks! Erik