【发布时间】:2012-06-18 16:54:01
【问题描述】:
所以在我的应用程序中,我使用了故事板,初始的 viewController 是 UITabBarController。我想要做的是当应用程序启动时,我希望能够设置 tabBarController 有 3 个或 4 个项目。所以在 appDel 中,我计划检查用户应该看到 3 或 4 个选项卡的天气,然后tabBarController 应该反映这一点。
我尝试将tabBarController 子类化,但它不起作用:
@implementation TabBarController
-(id) init{
if ((self = [super init])) {
[[[[self tabBar] items] objectAtIndex:2] setEnabled:YES];
[[[[self tabBar] items] objectAtIndex:3] setEnabled:NO];
[[[[self tabBar] items] objectAtIndex:3] setHidden:YES];
}
return self;
}
@end
我们将不胜感激。 提前致谢。
【问题讨论】:
标签: iphone ios uitabbarcontroller storyboard uistoryboard