开发者

UITabBar inside UINavigationController programmatically?

Im writing an app that has a navigation controller as it's main menu system but I need to be able to have a UITabBar appear inside the navigation controller when the user clicks one of the buttons on the main view. I have written everything programmatically so far so would like to keep it that way if possible.

So basically, how do I show a UITabBar inside the a navigation controller programmatically?

Many t开发者_JAVA技巧hanks :)


Depending on what you need to do you can either push a UITabBarController into the navigation controller or just add a UITabBar as a subview to a view that you need it on.


- (void) viewDidLoad {
 CGRect frame = ..create frame here..
 UITabBar *bar = [[UITabBar alloc] initWithFrame:frame];
 [self.view addSubView:bar]
}

It's that simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜