Adding Tab Bar View into an Existing Table Based App - iPhone

本小妞迷上赌 提交于 2020-01-17 05:19:33

问题


I have a table based app and would like to add a tab bar to the bottom to switch between this table and other views.

What is the msot hassle free way to do this ? Can I just wire in a tab view controller underneath the table view?

Thanks,

Martin


回答1:


You actually have to load your view controllers into a UITabBarController. So if you have a tableViewController, viewController1, and viewController 2, you want to add all those to the tabBarController.

UITabBarController *tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers:[NSArray arrayWithObjects:tableViewController, vc1, vc2];

[self.window addSubView:tabBarController.view];
[self.window makeKeyAndVisible];


来源:https://stackoverflow.com/questions/5406213/adding-tab-bar-view-into-an-existing-table-based-app-iphone

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