本文介绍了iOS启动屏幕上的动画活动指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在iOS启动屏幕上使用 UIActivityIndicator
?
Is it possible to use UIActivityIndicator
on the iOS launch screen?
我尝试过,但是不设置动画。
有人尝试过此方法还是不知道是否可能?
Has anyone tried this or know whether it's possible?
推荐答案
您要实现的目标是在启动屏幕上显示ActivityIndicator,但这是不可能的,但是您可以通过其他方法来实现它。
What you are trying to achieve is to show ActivityIndicator during launch screen which is not possible, but you can achieve it by some different way.
以下想法可能会为您提供帮助:
Here is the idea that may help you:
- 创建单独的加载页面&从应用程序委托中的didFinishLaunchingWithOptions方法调用它
- 添加启动画面&指示器
- 您可以将计时器设置为2-3秒,而不是重定向到应用程序的首页
-
同时使用指示器确保您已将StartAnimating检查为true或仅以编程方式像这样添加指示器:
- Create separate loading page & call it from didFinishLaunchingWithOptions method in App delegate
- Add Splash image & indicator to it
- You can set timer of 2-3 seconds than redirect to your first page of app
While using indicator make sure you have checked StartAnimating to true or simply add indicator programmatically like this:
UIActivityIndicatorView *activity = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(225, 115, 30, 30)];
[activity setBackgroundColor:[UIColor clearColor]];
[activity setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleGray];
[self.view addSubview: activity];
[activity startAnimating];
希望它对您有用。
这篇关于iOS启动屏幕上的动画活动指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!