我在启动屏幕后遇到了适用于 iOS 7 的 Cordova 3.0 中的白色闪光问题。在终端中我跑了:
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen.git
我生成的config.xml
文件如下:
<content src="./index.html" />
<feature name="LocalStorage">
<param name="ios-package" value="CDVLocalStorage" />
</feature>
<access origin="*" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="UIWebViewBounce" value="true" />
<preference name="TopActivityIndicator" value="gray" />
<preference name="EnableLocation" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="FadeSplashScreen" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.InAppBrowser" />
</feature>
我在资产目录中有适当的启动图像。每当我尝试运行这个应用程序时,它总是在启动屏幕上运行良好,但很快就会变成白色。太让人抓狂了;我查看了很多链接,并按照他们告诉我的做了,例如:
我究竟做错了什么?
更新:
哇,Phonegap。这是解决方案:
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen"/>
<param name="onload" value="true" />
</feature>