【发布时间】:2011-04-15 14:57:23
【问题描述】:
我有一个 UItabbarController,在第一个选项卡内有一个 UINavigationController。在界面生成器中,我将标签栏和导航栏设置为隐藏。
当第一个屏幕加载时(这是第一个选项卡的 Uinaviagtioncontroller 中的 UIVewcontroller),我将 NStimer 设置为 2 秒。之后它导航到第二个视图。现在,当这种情况发生时,我希望出现导航栏和标签栏,并且它应该是动画的。
这就是我现在正在做的事情。
第一个 UIViewController:
- (void)viewDidLoad {
[super viewDidLoad];
splashTime = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector (action) userInfo:nil repeats:NO];
}
-(void)action{
SecondViewController *m = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:m animated:YES];
}
第二个 UIViewController:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
self.hidesBottomBarWhenPushed = NO;
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
return self;
}
但实际上并没有发生任何事情。 Tabbar 或 NavigationBar 都不会出现。
【问题讨论】:
标签: iphone cocoa-touch xcode uinavigationcontroller uitabbarcontroller