简体   繁体   English

iOS启动图像没有故事板或图像

[英]iOS Launch Image without Storyboard or Images

I am trying to programmatically set up a Launch Image without using storyboards or images. 我试图以编程方式设置启动图像,而不使用故事板或图像。 I understand the two ways to set up a launch image are 'Launch Image Source(image)' & 'Launch Screen File (storyboard)'. 我知道设置启动图像的两种方法是“启动图像源(图像)”和“启动屏幕文件(故事板)”。 Within storyboard it launches a UIViewController then you drag and drop items into the storyboard VC. 在故事板中,它会启动一个UIViewController,然后将项目拖放到故事板VC中。 I don't want to do any drag and drops is there a way to just do it all in code. 我不想做任何拖拽有没有办法在代码中完成所有操作。 I am completely want to avoid storyboards I don't want to have an empty one then it launches a simple VC then I go do designated VC I want simple VC then designated VC. 我完全想避免故事板,我不想有一个空的然后它启动一个简单的VC然后我去做指定VC我想简单VC然后指定VC。 I am looking for an answer in Swift, I assume I would have to have code in AppDelegate but thats just a guess. 我在Swift中寻找答案,我假设我必须在AppDelegate中拥有代码,但这只是一个猜测。

There is no way to do this. 没有办法做到这一点。 You either have to provide images or a storyboard file. 您必须提供图像或故事板文件。 You can choose to show a custom launch screen afterwards that is programmatic, but you cannot create the initial one programmatically. 您可以选择在程序化之后显示自定义启动屏幕,但不能以编程方式创建初始启动屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM