Push a view on top of NOT within tab bar controller

Discussion in 'iOS Programming' started by newtoiphonesdk, Sep 4, 2012.

  1. newtoiphonesdk macrumors 6502a

    Jul 30, 2010
    I have a few tab bar applications that also use navigation controllers within the tab bar. I would like to be able to present a view when a cell in the table view is clicked, but have it not be IN the tab bar controller. This would be similar to the Twitter app when a link is clicked from within a Tweet. This way, the view for that link can be rotated, while everything else in the tab bar won't rotate. Here is how my code is setup now:

    self.webViewController = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease];
    [self.navigationController pushViewController:_webViewController animated:YES];
    I just want the view to cover up the tab bar, and therefore, let it rotate without needing to allow everything in tab bar to also rotate.
  2. CodeBreaker macrumors 6502

    Nov 5, 2010
    Sea of Tranquility
    You can add it as a subview to your applications window or perhaps the tab bar itself?
  3. Duncan C macrumors 6502a

    Duncan C

    Jan 21, 2008
    Northern Virginia
    Apple's UI guidelines specifically tell you not to do this. Tab bar applications are supposed to use the tab bar as the underlying way of presenting their UI.
    If some tabs hide the tab bar it breaks the paradigm.

    What you can do is to push a full-screen modal view controller using presentViewController:animated:completion: Modal view controllers temporarily break the flow of an application by displaying a modal view that must be acted on and dismissed before the user can continue. Thus it's reasonable to have a modal view controller NOT have a tab bar, then when the user dismisses it, the modal goes away and the tab bar is still there.

    That would be my suggestion.

Share This Page