Reputation: 499
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:acivityindicator];
[window makeKeyAndVisible];
[window bringSubviewToFront:acivityindicator];
[acivityindicator startAnimating];
But Only splash screen is working.Activityinicator does not appear.What wrong with me
Upvotes: 2
Views: 5359
Reputation: 5507
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!!
Upvotes: 0
Reputation: 854
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
Upvotes: 8