How to add tabbarcontroller in viewcontroller in iphone

拥有回忆 提交于 2019-12-11 06:25:30

问题


I am new to iphone development, i have created my project in view based application and i want to add tabbar controller in my view. I have added tabbarcontroller using interface builder in my view and i cannot see the tabbar in my view.

Plz how can i add tabbarcontrolller in view.

So plz guide me.

thanks.


回答1:


I'd recommend creating another app using the "Tab Bar Application" template, and then look at the differences between that and your app.




回答2:


In your AppDelegate:

- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after app launch    
    [window addSubview:[tabBarController view]];
    [window makeKeyAndVisible];
}

Where tabBarController is a outlet that's been plugged into the UITabBarController you made in InterfaceBuilder.



来源:https://stackoverflow.com/questions/2326814/how-to-add-tabbarcontroller-in-viewcontroller-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!