开发者

splash screen with activityindicator

I want to add splash screen in background and acttivity indicator in front...For that aI add following code in Appdelegate.m

splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];

acivityindicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(67, 24, 30, 30)];
acivityindicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite;
acivityindicator.autoresizingMask = (UIViewAutoresizingFlexibleLeftMargin |  UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin);



[window addSubview:splashView];
[window addSubview:acivityi开发者_Go百科ndicator];
[window makeKeyAndVisible];
[window bringSubviewToFront:acivityindicator];
[acivityindicator startAnimating];

But Only splash screen is working.Activityinicator does not appear.What wrong with me


You can't add any animation to the splash that launches when the user presses the icon. You can add a default.png, but that's about it. The device uses this time to prepare your application for launch.

Check out other apps, and you'll see that the creator usually puts a picture with the words loading, on it, or nothing at all. Also, read up on the IOS Human Interface Guidelines for more details.

Hope this helps =D


Best option is create a UIViewController. Make that rootViewController. This new viewController should be the same as splash screen look. Then implement UIActivityIndicator on it and show it. Then dismiss it and present your previous rootViewController.

Hope that works!!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜