简体   繁体   English

添加 png 后“Launch Screen.storyboard”黑色

[英]"Launch Screen.storyboard" black after adding png

Adding "Launch Screen.storyboard" works fine with the default white background, I get my logo and copyright, then move to Main.storyboard, all is good, app works fine.添加“Launch Screen.storyboard”在默认的白色背景下工作正常,我得到了我的标志和版权,然后移动到 Main.storyboard,一切都很好,应用程序工作正常。 Adding "Image View" to launch is also okay, but when I add the png in Media.xcassets to "Image View" the screen turns all black before moving on to Main.将“图像视图”添加到启动也可以,但是当我将 Media.xcassets 中的 png 添加到“图像视图”时,屏幕在转到 Main 之前变成全黑。 If I clear the png name from Image View/Image it all works, but goes back to the white background at launch time.如果我从图像视图/图像中清除 png 名称,一切正常,但在启动时返回到白色背景。 A darker version (so white text can be seen) of the same png serves as the background for Main.storyboard and that is fine.同一 png 的较暗版本(因此可以看到白色文本)用作 Main.storyboard 的背景,这很好。 What's the trick to get the launch screen png to show up in its view?让启动屏幕 png 显示在其视图中的技巧是什么? Xcode 12.4, deployment 12.0. Xcode 12.4,部署 12.0。 Thanks!谢谢!

The trick is to make your launch screen "small" enough (whatever that means) to be accepted.诀窍是让您的启动屏幕足够“小”(不管那意味着什么)以便被接受。 I solved the problem by simply taking a screen shot of the failing png, producing a new png that had smaller x/y dimensions and was about one third the original size (4.9 MB instead of 13.2 MB).我通过简单地拍摄失败的 png 的屏幕截图解决了这个问题,生成了一个新的 png,它具有更小的 x/y 尺寸并且大约是原始大小的三分之一(4.9 MB 而不是 13.2 MB)。 It looks the same to me.在我看来是一样的。 (The failing png worked fine in main.storyboard.) (失败的 png 在 main.storyboard 中运行良好。)

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

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