我正在尝试从我的启动屏幕中获得一个图像来显示为启动屏幕。故事板文件,但图像从不显示。我有标签显示良好,但图像不出现。

这是启动屏幕在启动屏幕中的外观。故事板文件:

然而,当我在模拟器(以及物理设备)上运行应用程序时,显示如下:

如您所见,标签“Test”显示良好,但图像没有显示。我真的不知道为什么会发生这种情况,我尝试的任何方法似乎都不起作用。如果任何人有任何关于如何解决这个问题的想法,这将是非常感激的。


当前回答

xCode中的资源缓存似乎有一些问题。有同样的问题,重新启动xCode和一切工作正常之后。

其他回答

I just figured this out. My launch image was not showing up, I get a white screen when launching on a device (iPhone 6, 7+) or testFlight. Fix: Renamed "Landing_screen.png" to just "Landing_screen" removing .png part. The image icon in Xcode changed to white icon and in the launch screen storyboard the image appears as a question mark now. The Launch image now appears and not the white screen. My Setup: I am using Swift 3.1 with Xcode 8.3.1. In LaunchScreen.storyboard I added a simple image view and stretched the image to fit the view controller. I set auto layout constraints Top/Bottom/Leading/Trailing space to superview to 0 - see image below:

正在改变背景图像的启动屏幕和新的图像不显示(反应原生项目)。

根据别人的回答。

我做了以下所有的事情,它是固定的:

清洁的构建。 从模拟器中删除应用程序 退出模拟器 重启XCode 再次运行app

我也遇到过同样的问题。我尝试了不同的解决方案,但都无济于事。然后我意识到,只有当我直接将应用程序安装到设备中,应用程序仍然连接到xcode时,图像才不可见。如果我断开它,然后打开应用程序的图像是可见的预期。 这可能是一个xcode错误。

按照以下步骤,

从设备中删除应用程序 重启设备 再次构建

如果不工作,删除派生数据。>Locationtab->派生数据。然后按照上面的步骤去做。

我有这个问题后,添加图像到项目和射击设备的问题解决了