UISegmentedcontrol to switch views in UITabbarcontroller
I am trying to switch between multiple different views using a UISegmentedControl
. I found a really good example to do this in:
http://redartisan.com/2010/6/27/uisegmented-control-view-switching-revisited
However, I need to use a UITabbarContro开发者_JS百科ller
in my app. So the navigation controller is not available for me in the app delegate. Is there any other way to switch views in a UITabbarController
using UISegmentedControl
?
First, consider whether you really want to do this. UITabBarController already gives you the ability to switch views, using the tab bar.
If you really want to do this for some reason, UITabBarController has properties viewControllers
and selectedViewController
that should allow you to do something like what is described in that article.
精彩评论