开发者

tabbar controller

I have a view 开发者_开发问答based application in which at a later point of time I have to load a tabbar controller. Can any one please tell me how to do this. I tried adding uitabbar but doesnt seem to work.

Thanks


tabbar controller

The better way is to take one UITabbarController in MainWindow.xib and bind it with your appDelegate's IBOutlet UITabbarController

[window addSubView:tabbarController.view];
[window addSubView:viewController.view];

Now make function

-(void)showTabBarController:(BOOL)bShown{
    tabbarController.view.hidden = !bShown;
    [window bringSubViewToFront:tabbarController.view];
}

Now call this function whenever necessary, For example, if you do not want tabbar at launching, you can hide it on didFinishLaunching by calling [self showTabBarController:FALSE];

and if you want to show tabbarcontroller at any view controller, you can unhide it by calling [appDelegate showTabBarController:TRUE];

Hope it helps


You can do this by using a normal tabbar, and then handling the tabbar call backs by making your view controller its delegate

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜