应用程序加载和飞溅屏幕 [英] App Loading and Splash Screen

查看:127
本文介绍了应用程序加载和飞溅屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用下载了大量数据,大约需要几秒钟。我的启动屏幕显示,然后消失,然后白色空白屏幕出现几秒钟之前,第一个视图加载。有没有办法保持初始屏幕出现?是否可以在AppDelegate中创建一个视图,并保持显示直到所有数据加载完成并且视图正在加载?

My app downloads quite a lot of data, which takes about a few seconds. My splash screen displays and then disappears and then a white blank screen appears for a few seconds before the first view is loaded. Is there a way to keep the splash screen appearing? Is it okay to create a view in the AppDelegate and keep it displayed until all the data loading has been completed and the view is about to load?

推荐答案

使用MBProgressHUD您可以在这里获取整个源代码。

Use MBProgressHUD You can get the whole source code here.

https://github.com/jdg/MBProgressHUD

希望这有帮助。

这是一个加载视图,它是活动指示器。

This is a Loading View which is Activity Indicator.

编辑:

当您在后台使用

[window addSubview:<backgroundView>.view];

然后一旦下载数据,您可以从窗口中删除相同的,并将您的主视图控制器添加到窗口

Then once data is downloaded, you can remove the same from window and add your main view controller into window

[<backgroundView>.view removeFromSuperView];
[window addSubview:<mainView>.view];

希望这有助于你。

这篇关于应用程序加载和飞溅屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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