UISegmentedcontrol to switch views in UITabbarcont

2019-05-22 12:50发布

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 UITabbarController 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?

1条回答
一纸荒年 Trace。
2楼-- · 2019-05-22 13:17

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.

查看更多
登录 后发表回答