开发者

How to implement a white screen after loading screen

when my application starts, I add a tabbarcontroller to my subview, after I present (with presentModalViewController开发者_开发知识库) a login screen.

What I want is a white screen just after the loading screen (Default.png) that's fades out to show the login screen.

Loading screen --> White view --> Fade out --> Login Screen

How can I implement this?

Thanks.


You need to add a white view on your window in the application delegate like:

[window addSubview:viewController.view];
[window addSubview:whiteView];
[window makeKeyAndVisible];

Then after the desired time remove the white view with the help of animation like:

- (void) fadeWhiteView{
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3];
    [UIView setAnimationDidStopSelector:(animationDidStop:finished:context:)];
    [whiteView setAlpha:0.0];
    [UIView commitAnimations];
}

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context{
    [whiteView removeFromSuperview];
    [whiteView release];
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜