我想在后台添加闪屏和活动指示器在front...For中,aI在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];但唯一的闪屏是working.Activityinicator不与我appear.What错误
发布于 2011-09-16 16:23:58
您不能在用户按下图标时启动的启动画面中添加任何动画。您可以添加default.png,但仅此而已。设备使用这段时间来准备要启动的应用程序。
看看其他的应用程序,你会发现创建者通常会放一张图片,上面写着加载,或者什么都没有。此外,请阅读IOS Human Interface Guidelines以了解更多详细信息。
希望这能帮上忙=D
发布于 2012-09-20 16:55:58
最好的选择是创建一个UIViewController。让它变成rootViewController吧。这个新的viewController应该与splash screen外观相同。然后在上面实现UIActivityIndicator并展示出来。然后放弃它,展示你之前的rootViewController。
希望它能起作用!!
https://stackoverflow.com/questions/7441581
复制相似问题