使用Xcode6在iOS中启动屏幕上的活动指示器 [英] Activity Indicator on launch screen in iOS using Xcode6

查看:145
本文介绍了使用Xcode6在iOS中启动屏幕上的活动指示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Xcode6的启动画面中使用UIActivityIndi​​cator

Is it possible to use UIActivityIndicator in launch screen with Xcode6

我试过但它不是动画,不确定它是否可能。

I tried but its not animating, not sure whether its possible or not.

任何人都可以尝试这个或知道它是否可能吗?

Can anyone tried this or knows whether its possible or not?

谢谢 -

推荐答案

您要实现的目标是在启动屏幕中显示ActivityIndi​​cator,这是不可能的,但您可以通过某种不同的方式实现它。

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:


  • 创建单独的加载页面&从App delegate中的didFinishLaunchingWithOptions方法调用它

  • 添加Splash图像&指标

  • 您可以设置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];


希望它适合你。

这篇关于使用Xcode6在iOS中启动屏幕上的活动指示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆