首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有活动指示器的闪屏

带有活动指示器的闪屏
EN

Stack Overflow用户
提问于 2011-09-16 15:42:13
回答 2查看 5.1K关注 0票数 2

我想在后台添加闪屏和活动指示器在front...For中,aI在Appdelegate.m中添加以下代码。

代码语言:javascript
复制
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错误

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-09-16 16:23:58

您不能在用户按下图标时启动的启动画面中添加任何动画。您可以添加default.png,但仅此而已。设备使用这段时间来准备要启动的应用程序。

看看其他的应用程序,你会发现创建者通常会放一张图片,上面写着加载,或者什么都没有。此外,请阅读IOS Human Interface Guidelines以了解更多详细信息。

希望这能帮上忙=D

票数 8
EN

Stack Overflow用户

发布于 2012-09-20 16:55:58

最好的选择是创建一个UIViewController。让它变成rootViewController吧。这个新的viewController应该与splash screen外观相同。然后在上面实现UIActivityIndicator并展示出来。然后放弃它,展示你之前的rootViewController。

希望它能起作用!!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7441581

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档