ios 为什么 PhoneGap 总是显示默认的闪屏图像?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18866450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why PhoneGap always shows default splashscreen image?
提问by Tien Do
I'm testing a sample iOS app now, although I set all new launch images in Xcode (Summary tab of Project Target screen), PhoneGap 3.0 keeps showing its default splashscreen. Why? even when splashscreen is a plugin and not included by default in PhoneGap 3.0 now.
我现在正在测试一个示例 iOS 应用程序,尽管我在 Xcode(项目目标屏幕的摘要选项卡)中设置了所有新的启动图像,但 PhoneGap 3.0 一直显示其默认启动画面。为什么?即使闪屏是一个插件并且现在默认情况下不包含在 PhoneGap 3.0 中。
iOS document say about launch images but not splashscreen, and it even strongly recommend us to use a "first screen" similar as launch image, not something like about screen. Are these same?
iOS 文档说的是启动图像而不是闪屏,它甚至强烈建议我们使用类似于启动图像的“第一屏”,而不是类似于屏幕的东西。这些都一样吗?
采纳答案by Tien Do
It's not about cleaning or caching issues at all. The problem is PhoneGap includes all possible launch images in project template by default. These files are under Resources folder and copied to bundle's root folder on build event. Although I properly selected my own launch images in Xcode (Target/Summary screen), default PhoneGap's specific files e.g. Default~iphone.png overridden my files :(
这根本不是关于清理或缓存问题。问题是 PhoneGap 默认在项目模板中包含所有可能的启动图像。这些文件位于 Resources 文件夹下,并在构建事件时复制到包的根文件夹。尽管我在 Xcode(目标/摘要屏幕)中正确选择了自己的启动图像,但默认 PhoneGap 的特定文件(例如 Default~iphone.png)覆盖了我的文件:(
Once issue is identified, you can fix it someway, but I prefer below steps:
确定问题后,您可以通过某种方式修复它,但我更喜欢以下步骤:
Delete all default icons and splashscreen files under /platforms/ios/AppName/icons and /splash folders. You surely don't need these placeholder images.
In Xcode, select Targets/AppName, then tab Build Phases, delete all file names of images in the above step in section Copy Bundle Resources.
Add your own images files for app icon and launch images here.
Edit Info.plist file (file AppName-Info.plist under /platforms/ios/AppName/) to include your images, you will need to use CFBundleIcons and UILaunchImageFile keys. Go to iOS developer site for reference.
删除 /platforms/ios/AppName/icons 和 /splash 文件夹下的所有默认图标和闪屏文件。您肯定不需要这些占位符图像。
在 Xcode 中,选择 Targets/AppName,然后选择 Build Phases,删除上面复制捆绑资源部分中的所有图像文件名。
为应用程序图标添加您自己的图像文件并在此处启动图像。
编辑 Info.plist 文件(/platforms/ios/AppName/ 下的文件 AppName-Info.plist)以包含您的图像,您需要使用 CFBundleIcons 和 UILaunchImageFile 键。转至 iOS 开发者网站以供参考。
回答by jonas
Splashscreen and launch image are the same thing.
启动画面和启动图像是一回事。
You probably did everything right but iOS (especially in the simulator) often just doesn't change those things (splashscreen, icon etc.) during development process. Try to delete your app, clean your project (in Xcode: Product -> Clean (shift+cmd+k)) and reinstall your app.
您可能做对了所有事情,但 iOS(尤其是在模拟器中)在开发过程中通常不会更改这些内容(启动画面、图标等)。尝试删除您的应用程序,清理您的项目(在 Xcode 中:Product -> Clean (shift+cmd+k))并重新安装您的应用程序。