I have a running project with 2 xibs for 2 UIViewControllers (no storyboard). I am looking for the shortest way to add tabs at the bottom of the screen being able to switch between the views via the tabs.
Thanks,
Simon
SHORT ANSWER:
MainWindow
add a UITabBarController
UITabBarController
add UITabBarItem
s for a UINavigationController
UINavigationController
s set the RootViewController
to be the UIViewController
s that you have already EDIT: More detailed steps, but not necessarily perfect:
MainWindow.xib
or its RootViewController
) UITabBarController
(ie mainWindow.rootViewController = tabBarController
in code) UINavigationController
. If you are using XIB, then just drag new navigation controllers to the tab bar. If you are using code, use tabBarController.viewControllers = @[navController1,navController2,navController3,...]
rootViewController
to be your ViewController
you want to add.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.