以编程方式编码应用程序后启动屏幕 [英] Launch Screen after programmatically coding app

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

问题描述

我一直在以编程方式编写一个应用程序,但我突然决定在启动屏幕上做一些工作,自从我创建项目文件以来我就没有碰过它,我尝试添加 UILabel 文本以及 UIImageView (两者都分别带有约束),但是我似乎无法让 LaunchScreen 在模拟器上显示我的设备.

I've been programmatically coding an app and I suddenly decided to do some work on the Launch Screen, I haven't touched it since I created the project file and I've tried adding a UILabel text as well as UIImageView (both respectively with constraints), however I can't seem to get the LaunchScreen to show on simulator my device.

有人有在非故事板项目中使用启动屏幕的经验吗?有没有关于如何让它工作的提示?

Does anyone have any experience working with launch screens on a non-storyboard project? Any tips to offer on how to get it to work?

我的启动屏幕勾选了所有适当的框,例如用作启动屏幕Is Initial Controller

My launch screen has all the appropriate boxes ticked, such as Use as Launch Screen and Is Initial Controller

推荐答案

也许你的期望是错误的.启动屏幕不是启动屏幕;这只是为了让用户感觉到在应用程序实际启动并运行之前点击跳板中的图标后,在令人心碎的时刻正在发生某些事情.它将非常简短地显示,并且应该或多或少与应用程序的初始界面相同(通常会减去很多细节).您可能需要打开慢速动画才能看到启动屏幕;如果您的应用在启动期间几乎没有做任何事情(这很好),即使那时您也可能几乎看不到启动屏幕!

Maybe your expectations are wrong. A launch screen is not a splash screen; it's just to give the user some sense that something is happening in the heart-stopping moment after tapping an icon in the springboard before the app is actually up and running. It will show very briefly and should be more or less identical to the initial interface of the app (usually minus a lot of detail). You might have to turn on Slow Animations to see the launch screen at all; if your app does very little during launch (which is good) you might barely see the launch screen briefly even then!

在此示例中,启动屏幕是红色的,即使使用慢速动画,它在应用程序填满屏幕之前很久就已淡化为实际应用程序的白色:

In this example the launch screen is red and even with Slow Animations it has faded to the white of the real app long before the app fills the screen:

这篇关于以编程方式编码应用程序后启动屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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