Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

onsen ui v2 display only ios css for all platform



  • how can i display ios platform for all dives (android , ios)



  • @memo Just place this at the top of your JS block:

    ons.disableAutoStyling();
    


  • @munsterlander thanx my friend for answer … i can edit onsenui.js in lin

     ons.platform.select((window.location.search.match(/platform=([\w-]+)/) || [])[1]); 
    

    to

     ons.platform.select('ios'); 
    

    its too work:blush:



  • @memo No need to do that. Just in your index template, after you have included all of your Onsen CSS and JS files, do a script tag with that. After that script tag, you can run all of your application specific code, such as:

    <!DOCTYPE HTML>
    <html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
        <link rel="stylesheet" href="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/css/onsenui.css" type="text/css" media="all" />
        <link rel="stylesheet" href="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/css/onsen-css-components.css">
        <script src="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/js/onsenui.js"></script>
        <script src="components/loader.js"></script>
        <script>    
    ons.disableAutoStyling();
    
    // All other code goes below
    ons.ready(function(){
      alert('Onsen is loaded.');
    });
        </script>
    
    </head>
    <body>
     <ons-page>
      <ons-toolbar>
        <div class="center">My app</div>
      </ons-toolbar>
    </ons-page>
    </body>
    </html>
    


  • @munsterlander Yes, I understand you friend your style is more correct … but I worked my way before you answer me … now I applied your style



  • @memo Oh! Ok, I understand. I just didn’t want to cause any confusion because modifying that file/line could impact other functions of Onsen. Glad you have it working! :bowtie:



  • @munsterlander You’re right because onsen is very sensitive with her functions