【发布时间】:2015-07-09 07:25:48
【问题描述】:
我尝试向 iOS 现有项目添加第二个初始屏幕,该项目太旧并且使用 xib。
所以我打算先显示默认启动画面,然后在登录页面之后显示我自己的一个图像作为启动画面。
这是我到目前为止所做的
在我的ViewController.m 文件中,我在UIView 上创建并添加了一个UIImageView,但问题是我可以看到导航栏以及第二个初始屏幕。
我不想要那个导航栏。
请帮帮我 代码
ViewController.m in ViewDidload ()
self.navigationController.navigationBar.hidden=YES;
_splash.frame=CGRectMake(0,0,self.view.frame.size.width,self.view.frame.size.height);
_splashImg.frame=_splash.frame;
[self.view insertSubview:_splash aboveSubview:_loginView];
[NSTimer scheduledTimerWithTimeInterval:3.0f target:self selector:@selector(runMethod) userInfo:nil repeats:NO];
[self.view addSubview:_splashView];
[self.view bringSubviewToFront:_splashView];
UIImageView *img=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"rss2.png"]];
img.frame=_splashView.frame;
[_splashView addSubview:img];
【问题讨论】:
-
为什么要添加为导航控制器的根视图控制器。
-
请参考我的回答。
标签: ios objective-c uiview uiimageview splash-screen