views:

40

answers:

2

I have an application with a navigation bar and a tab bar. A user can navigate to a view which displays images in a scroll view. I'd like to have the same behavior as the iPhone photo app: Nav bar at the top, tool bar at the bottom, which will hide or show based upon a tap.

I'm moving my view to the window object in order to achieve full screen mode. This works fine:

    myView = [self.view retain];
    self.view = nil;
    [window addSubview:myView];

But when I want to redisplay the Nav & tool bar, I run into a problem. The bars show fine, but the view is empty, and I can't seem to add any content to the view:

    [myView removeFromSuperview];
    self.view = myView;

I got a lot of good info from this post

but can't quite get the right combination.

A: 

By simply setting the controller's view, you aren't adding it as a subview to anything else, so it will never appear.

Moving views around like this can get a little tricky. I recommend that you not move the view from one to the other, but instead have two UIViews. Add second UIView to the window's subview and set it to hidden=YES initially. When you want to show it, set the image for the UIImageView, and then set the hidden property to NO.

Chris Garrett
A: 

what's wrong with just using setNavigationBarHidden: animated: and setToolbarHidden:animated:?

filipe