目标是在闪屏视图上放置一个按钮,这是不可能的,因为Default.png是静态图像,所以我所做的是在第一个iOS出现时立即显示一个modalViewController。这恰好是由TabController托管的ViewController。问题是,有一个很小的间隙,一旦闪屏消失,SplashViewController显示(带有相同的图像,但处于活动状态),用户就可以简单地看到下面的视图。
我正在使用presentModalViewController来显示活动的启动视图。有没有办法解决这个问题,我在底层视图控制器的viewWillAppear方法中调用presentModalViewController。我想我需要的是以某种方式显示活动的闪屏早于此
谢谢
发布于 2012-08-17 21:33:06
是的,你可以做到这一点--我的应用程序就是这么做的。我所做的是在'didFinishLaunchingWithOptions:‘中,我首先在UIImageView中添加了相同的启动图像作为窗口的子视图:
UIImageView *launchView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
UIImageView *normalView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:<shorter version of launch image, allowing space for activity bar]];
[window addSubview:launchView];
if(isMember) {
[window addSubview:normalView];
normalView.alpha = 0;
[UIView animateWithDuration:0.25 animations:^
{
launchView.alpha = 0;
normalView.alpha = 1;
}
completion:^(BOOL finished)
{
[launchView removeFromSuperview];
} ];
}
[window makeKeyAndVisible];
然后添加带有一个rootViewController的导航控制器Then控制器。您可以将viewController设置为clearColor,也可以将modalController backgroundColor设置为clearColor-您将不得不解决此问题。
https://stackoverflow.com/questions/12003872
复制相似问题