开发者

Changing UIViewController tab bar view to UINavigationController in Xcode 4

开发者 https://www.devze.com 2023-03-28 21:08 出处:网络
I am trying to modify a newly placed UITabBarItem item from a UIViewController to a UINavigationController in XCode 4.

I am trying to modify a newly placed UITabBarItem item from a UIViewController to a UINavigationController in XCode 4.

Here is a screenshot of a new view controller called "Near Me" and existing view controllers.

Changing UIViewController tab bar view to UINavigationController in Xcode 4

Notice how the new 开发者_开发技巧one is a UIViewController, I need this changed to a UINavigationController.

Something as simple as this was easily done in Xcode 3.2 and now that Apple has introduced Xcode 4 - it is just horribly difficult to re-learn this new IDE.


You shouldn't modify a UIViewController to be a UINavigationController. Even though a UINavigationController is a subclass of UIViewController, its job is to manage other View Controllers, not Views.

In IB you should create a UINavigationController and then set the existing UIViewController as the root controller of the new UINavigationController.


You can change it in the menu on the right hand side. Just change the class. I hope this is what you are asking for.

Changing UIViewController tab bar view to UINavigationController in Xcode 4


First you create window based application an in that MainWindow.xib file put tabBar Controller. Then delete that two UIView controller and add navigation controller under tabBar Controller. You can see below in screen shot.

Changing UIViewController tab bar view to UINavigationController in Xcode 4

0

精彩评论

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