0
我有一個加載UINavigationController的UITabBarController。是否可以從UINavigationController中推送UITabbarController?
當我推新視圖控制器,是否有可能將UITabBarController更改爲一組新的選項卡?
我有一個加載UINavigationController的UITabBarController。是否可以從UINavigationController中推送UITabbarController?
當我推新視圖控制器,是否有可能將UITabBarController更改爲一組新的選項卡?
當然,爲什麼不重新分配你的新的UIViewController的數組到UITabBarController的viewControllers屬性?這將做到這一點。
- (void)addNewControllers {
NSMutableArray *controllers = [NSMutableArray array];
UIViewController *c0 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c0];
UIViewController *c1 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c1];
UIViewController *c2 = [[[UIViewController alloc] init] autorelease];
[controllers addObject: c2];
[myTabBarController setViewControllers:controllers];
}
瞭解更多關於潛在的副作用here。
即時通訊不知道如果我關注。你可以給我一個鏈接或提供示例代碼? – 2010-06-10 02:42:51
當然 - 我編輯了一些代碼來看看我的回覆。 – randombits 2010-06-10 03:11:19