How to prevent image resizing / conversion when UINavigationBar hides / shows

I have an application with a tab bar and a navigation bar. I press the view controller, which is used to display photos one at a time. First, it shows the bars and controls forward / backward; after a delay, they hide using setNavigationBarHidden:animated: and a custom transform ( CGAffineTransformMakeTranslation ) in the tab bar. This works, but viewing the view controllers that shows the photo jumps up and down. The same is true if I exit the tab bar from the equation.

How can I prevent the UINavigationBar from moving my view? I want the photo to remain stationary on the screen, while the navigation bar drops to the top segment.

+7
iphone resize uiimageview uinavigationbar uitabbar
source share
4 answers

I know this is an old question, but I achieved this by disabling "Autoresize Subviews" in Interface Builder

alt text

0
source share
 [[navigationController navigationBar] setBarStyle:UIBarStyleBlackTranslucent]; [[navigationController navigationBar] setAutoresizesSubviews:NO]; 

it seemed to do the trick for me!

+1
source share

If this problem is fixed with a class inherited from UINavigationController

 -(void)viewWillAppear:(BOOL)animated { self.navigationBar.translucent = YES; } 

It worked UIBarStyleBlackTranslucent for me, it was not necessary to set the UIBarStyleBlackTranslucent style. So he kept my colors.

+1
source share

I could not find the right way to handle this, except to set the navigationBar style to translucent, as in:

 theNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; 

Besides creating another navigation bar and adding buttons to it, this is the best (and it seems this is what Apple does in this Photo app)

0
source share

All Articles