2010-05-10 58 views
0

我仍然不清楚如何以及何時使用界面生成器。我有一個基於Tabbar的應用程序,我在其中添加了6個導航控制器。我需要3個「More」選項卡,它允許用戶配置他想要的選項卡,而不是6個選項卡。在基於界面生成器的TabBar應用程序中處理更多的導航控制器

有沒有辦法用IB來做到這一點?如果沒有,我怎麼能從IB移動到一個基於代碼的tabbar(前提是我已經設置了一個TabBarController類來處理shouldAutoRotate :)

在此先感謝!

回答

-1

我解決了我的問題。在我ApplicationDelegate

感謝

[window addSubview:tabBarController.view]; 

http://www.mactech.com/articles/mactech/Vol.25/25.03/iPhoneProductivityApplicationsPart1/

:既然我已經有階級的指定 TabBarController在IB我的標籤欄控制器,我添加了這個:

NSMutableArray *customizeable = [[NSMutableArray alloc] init]; 
for (id controller in tabBarController.customizableViewControllers) 
{ 
    if ([controller isKindOfClass: [MyCustomizeable class]]) 
     [customizeable addObject:controller]; 
} 
tabBarController.customizableViewControllers = customizeable; 
[customizeable release]; 

只是波紋管

請注意,我可以用這些行來完成這項工作:

NSMutableArray *customizeable = [[NSMutableArray alloc] init]; 
tabBarController.customizableViewControllers = customizeable; 
[customizeable release]; 

但我想控制哪些標籤可以重新編排

相關問題