简体   繁体   English

修改启动屏幕故事板

[英]Modify launch screen storyboard

i've added a launch screen storyboard in my project. 我在项目中添加了启动屏幕故事板。 The storyboard contains a UIView with a UIImageView. 故事板包含带有UIImageView的UIView。 The UIImageView shows a .png that i download from a server, and this image could be different every day. UIImageView显示了我从服务器下载的.png文件,并且该图像每天可能都不同。 I noticed that iOS cache the images created from the storyboard, but when i start the app with a different image, it shows the older one, and not the one i've downloaded. 我注意到iOS会缓存从情节提要中创建的图像,但是当我用不同的图像启动该应用程序时,它显示的是较旧的图像,而不是我下载的图像。 The solution should be to change the storyboard to tell the OS that the splash is changed and it could generate new images. 解决方案应该是更改情节提要,以告知操作系统初始设置已更改,并且可能生成新图像。 But i don't able to tell the OS the storyboard is changed and it show always the same image. 但是我无法告诉操作系统故事板已更改,并且它始终显示相同的图像。 I've tried to change the structure of the view controller adding some views. 我试图更改添加一些视图的视图控制器的结构。

The launch screen interface is supposed to be static, it is loaded before your code starts running. 启动屏幕界面应该是静态的,在您的代码开始运行之前已加载它。 So there should be no way to dynamically change the images there. 因此,应该没有办法动态更改那里的图像。

Maybe someone will find an obscure solution for that, but my guess is that it's not possible right now. 也许有人会为此找到一个晦涩的解​​决方案,但是我猜想现在还不可能。

Your project should contain a launch screen .xib file when you create it. 创建项目时,您的项目应包含启动屏幕.xib文件。 You can simply edit the .xib to your liking. 您可以根据自己的喜好编辑.xib。 There's no need for a new/separate storyboard file. 不需要新的/单独的情节提要文件。

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

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