开发者

iPhone app architecture with tab bars

I have an app that uses a tab bar controller. It has five tabs.

I need to base each tab on a UINavigationController. Do I require another view controller inside the nav controller, or is it valid to have a UINavigati开发者_运维知识库onController controlling a regular view?

(I'm guessing the latter but I'm really hitting a wall today getting it to work .. )


UINavigationController is created by setting a rootViewController inside it.

- (id)initWithRootViewController:(UIViewController *)rootViewController

That root view controller will control the view.

In your tab bar controller, you can add the UINavigationController.


Drag "Navigation Controller" icon to "Tab Bar Controller" in Interface Builder.
You will be able to use UINavigationController with UITabBarController.

In addition, if you drag "Table View Controller" to "View Controller" inside the "Navigation Controller", they are exchanged and you can use UINavigationController + UITableView + UITabBarController.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜