Search code examples
ipaduinavigationcontrolleruitabbarcontrolleruipopover

PopOver containing Navigation bar and Tabbar


Can you help me with PopOver controls?

I want to display UITabbar Controller and UI Navigation controller in the UIPopOver. Do you know any good tutorial to start.

I know how to work with UITabbar Controller and Navigation controller as an Application View but don't know how to use them UIPopOver.

Thanks,

Paras Mendiartta


Solution

  • If you know how to create a UIViewController object with a navigation and/or tab bar, then all you have to do to place it in a popover is:

    UIPopoverController *myPopover = [[UIPopoverController alloc] initWithContentViewController:myViewController];
    

    where "myViewController" is the UIViewController object that contains your view with navigation bar, tab bar, etc. You could create the view controller in the interface builder or programmatically--whatever suits you. Then you would present the popOver from either a position in your parent view or barButtonItem using either of the respective UIPopoverController methods: presentPopoverFromRect or presentPopoverFromBarButtonItem.