2

我試圖在使用UISegmentedControl的多個不同視圖之間切換。我發現了一個很好的例子: http://redartisan.com/2010/6/27/uisegmented-control-view-switching-revisitedUISegmentedcontrol在UITabbarcontroller中切換視圖

但是,我需要在我的應用程序中使用UITabbarController。所以導航控制器在應用程序代理中不適用於我。是否有任何其他方式使用UISegmentedControlUITabbarController中切換視圖?

回答

2

首先,考慮你是否真的想這樣做。 UITabBarController已經使您能夠使用標籤欄切換視圖。

如果你真的想這樣做是出於某種原因,UITabBarController的屬性viewControllersselectedViewController應該允許你做一些類似於那篇文章中描述的內容。

+1

我明白,UITabBarController提供了切換視圖的能力,但我期待在每個標籤欄項目中提供子級別。 – 2011-03-13 15:19:09

+0

如果這就是你正在做的事,爲什麼不能使用你已經擁有的UINavigationController解決方案作爲每個選項卡中的視圖控制器? – Anomie 2011-03-13 16:27:05

+0

該教程似乎使用NSObject作爲SegmentsController。既然它不是UIView,我不確定Mark是否可以用它作爲tabbar視圖。 – Ayrad 2011-06-08 20:42:05