问题
I have a Ionic Cordova project and am trying to make sure that it is fullscreen on iPhone X and newer phones. I have gone to questions like this one and everything works fine until I run ionic prepare
and it removes <key>UILaunchStoryboardName</key><string>CDVLaunchScreen</string>
from the .plist file. I tried adding this:
"config_munge": {
"files": {
"*-Info.plist": {
"parents": {
"UILaunchStoryboardName": [
{
"xml": "<string>CDVLaunchScreen</string>",
"count": 1
}
],
to my ios.json and that doesn't help. I also tried this in my config.xml file:
<platform name="ios">
<config-file parent="UILaunchStoryboardName" target="*-Info.plist">
<string>CDVLaunchScreen</string>
</config-file>
And that doesn't help. If I set it in both the Info > Custom iOS Target Properties
and set the General > App Icons and Launch Images > Launch Screen File
to CDVLaunchScreen
but all that always gets overwritten with the next ionic prepare
command. How do I prevent that from being overwritten?
P.S. my Cordova version is 8.1.2 and iOS is engine is 5.0.0. Also, if it makes a difference, here are my plugins:
- cordova-plugin-cocoapod-support 1.6.2 "Cordova CocoaPods Dependency Support"
- cordova-plugin-device 2.0.2 "Device"
- cordova-plugin-screen-orientation 3.0.2 "Screen Orientation"
- cordova-plugin-splashscreen 5.0.2 "Splashscreen"
- cordova-plugin-statusbar 2.4.3 "StatusBar"
- cordova-plugin-whitelist 1.3.4 "Whitelist"
- cordova-plugin-wkwebview-engine 1.2.2-dev "Cordova WKWebView Engine" cordova-plugin-wkwebviewxhrfix 0.1.0 "WKWebView XHR Fix"
- cordova.plugins.diagnostic 5.0.1 "Diagnostic"
回答1:
I didn't have this in the config.xml file and so it was removing it in cordova prepare
:
<splash src="res/screen/ios/Default@2x~iphone~anyany.png" />
<splash src="res/screen/ios/Default@2x~iphone~comany.png" />
<splash src="res/screen/ios/Default@2x~iphone~comcom.png" />
<splash src="res/screen/ios/Default@3x~iphone~anyany.png" />
<splash src="res/screen/ios/Default@3x~iphone~anycom.png" />
<splash src="res/screen/ios/Default@3x~iphone~comany.png" />
<splash src="res/screen/ios/Default@2x~ipad~anyany.png" />
<splash src="res/screen/ios/Default@2x~ipad~comany.png" />
来源:https://stackoverflow.com/questions/60197628/uilaunchstoryboardname-and-its-value-cdvlaunchscreen-is-being-removed-by-ionic