【问题标题】:White page showing after splash screen before app load (cordova-Android)应用加载前启动画面后显示的白页(cordova-Android)
【发布时间】:2016-07-28 11:03:22
【问题描述】:

我正在开发一个 Cordova android 应用程序来使用 inappbrowser 加载网站,我不知道为什么我在启动屏幕后有白页,所以我想摆脱它,这是我的 index.html 代码:

<!DOCTYPE html>

<html>
    <head>
        <meta name="format-detection" >
        <meta name="msapplication-tap-highlight" content="no">
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
        <title>InApp Browser</title>
       
    </head>
    <body>      
		
		
        <script type="text/javascript" src="js/jquery.js"></script>	
		<script type="text/javascript" src="cordova.js"></script>
		<script type="text/javascript" src="js/app.js"></script>
    </body>
</html>

这是我的 config.xml :

<?xml version='1.0' encoding='utf-8'?>
<widget id="tn.example.inapptest" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>inapptest</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    <splash src="res/screen/android/splash-port-hdpi.png" density="port-hdpi"/>
    <splash src="res/screen/android/splash-port-ldpi.png" density="port-ldpi"/>
    <splash src="res/screen/android/splash-port-mdpi.png" density="port-mdpi"/>
    <splash src="res/screen/android/splash-port-xhdpi.png" density="port-xhdpi"/>
    <icon src="res/screen/android/ldpi.png" density="ldpi" />
    <icon src="res/screen/android/mdpi.png" density="mdpi" />
    <icon src="res/screen/android/hdpi.png" density="hdpi" />
    <icon src="res/screen/android/xhdpi.png" density="xhdpi" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <preference name="SplashScreenDelay" value="50000" />
     <preference name="FadeSplashScreen" value="false"/>
     <preference name="SplashScreenBackgroundColor" value="0xFFFFFFFF"/>
    <plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />
    <plugin name="cordova-plugin-dialogs" spec="~1.2.1" />
</widget>

【问题讨论】:

    标签: javascript android html cordova splash-screen


    【解决方案1】:

    由于您的应用程序的主题选择而显示白页,或者可能是您正在做许多工作并且正在主线程中工作的登录页面。所以,它发生了。

    主题选择很可能取决于这个问题。

    android:theme="@android:style/Theme.Translucent.NoTitleBar"
    

    有一次我遇到了同样的问题,我在清单文件中设置了这个主题。所以,我已经处理了这个问题。

    谢谢,希望对你有帮助:)

    【讨论】:

    • 我也做过同样的事情,可能是你在着陆页上做的很重。所以,这需要时间
    猜你喜欢
    • 1970-01-01
    • 2017-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多