简体   繁体   中英

Onsen UI issues 'white screen' angularJS code shows up

My cordova app is not worthy any more. It shows up angular expressions on application run. shows white screen at times at launch I think it might be issue of JS dependencies. I posting my JS dependencies order

<!-- JS dependencies (order matters!) -->
    <script src="scripts/platformOverrides.js" type="text/javascript"></script>
    <script src="lib/angular/angular.js" type="text/javascript"></script>
    <script src="lib/onsen/js/onsenui.js" type="text/javascript"></script>
    <script src="lib/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyD5sCjiaGLF8i8zul_W4GBsnMBY9mZTdB4&libraries=places"></script>

    <!-- Cordova reference -->
    <script src="cordova.js"></script>
    <script src="scripts/index.js" type="text/javascript"></script>
    <script type="text/javascript" src="bower_components/ngCordova/dist/ng-cordova.js"></script>

    <!-- CSS dependencies -->
    <link rel="stylesheet" href="lib/onsen/css/onsenui.css" />
    <link rel="stylesheet" href="lib/onsen/css/onsen-css-components-blue-basic-theme.css" />
  <!--   <link rel="stylesheet" type="text/css" href="lib/pace.theme.css"> -->
    <!-- CSP support mode (required for Windows Universal apps) -->
    <link rel="stylesheet" href="lib/angular/angular-csp.css" />
    <link rel="stylesheet" type="text/css" href="index.css">
    <link rel="stylesheet" href="animate.css" />

screenshot of issue

Is this because of wrong order of the dependencies or internet problems or anything I'm missing or I could do to work it perfectly

This might be a little late, but this can be solved by doing 2 things. 1.) Increase the time the splash screen is shown via the config.xml file to about 5000 ms. 2.) In the ons.ready() function, add: navigator.splashscreen.hide();

This shows the splashscreen, hiding the white screen as your libraries load, and then hides it when the app is ready. This solved my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM