如何在iPhone应用程序的初始屏幕中添加UIActivityIndi​​cator? [英] How to add a UIActivityIndicator to a splash screen in a iphone application?

查看:57
本文介绍了如何在iPhone应用程序的初始屏幕中添加UIActivityIndi​​cator?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将UIActivityIndi​​cator添加到初始屏幕?

How to add a UIActivityIndicator to a splash screen ?

我尝试了以下操作

我创建了名为SplashViewController的UIViewController子类.并且代码如下所示,但是图像仍然无法持久存储足够长的时间.

I created UIViewController Sub class called SplashViewController. and the code is as below, still the image is not persisting long enough .

推荐答案

如果通过启动画面"表示您的应用启动时显示的图像,则答案是您不能.

If by "Splash Screen" you mean the image that is displayed when your app launches, the answer is that you can't.

您可以做的是创建一个初始视图,其中包含一个看起来与启动图像相似的背景图像,然后在该视图中添加一个活动指示器.对于用户,活动指示器似乎是启动图像的一部分".

What you can do is have an initial view that includes a background image that looks just like your launch image, and then add an activity indicator into that view. To the user, it will appear that the activity indicator is "part" of your launch image.

诀窍是尽快加载初始笔尖(使其小而简单),以便静态图像过渡到可以立即操作的视图.

The trick is to load your initial nib as quickly as possible (keep it small and simple) so the static images transitions to a view you can manipulate right away.

这篇关于如何在iPhone应用程序的初始屏幕中添加UIActivityIndi​​cator?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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