1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    27
    Vote Rating
    0
    Answers
    1
    janardhan pasumarthi is on a distinguished road

      0  

    Default Answered: How to Apply Device Specific themes ( Android,iOs,BlackBerry ) in sencha touch?

    Answered: How to Apply Device Specific themes ( Android,iOs,BlackBerry ) in sencha touch?


    Hi All,

    I want to apply device specific themes to my sencha touch application. Currently it is showing only the default theme (blue) as i've added sencha-touch.css file.
    Can any one help me how to load device specific themes in my application?


    Thanks.

  2. Hi All,


    I've achieved this by checking Os name and loading the corresponding css file which is provided by sencha. Code looks like below:


    if( Ext.os.is( OSNAME.BLACKBERRY ) ) {

    loadCss( OSNAME.BLACKBERRY_CSS_URL ); // css url will be like touch/resources/css/bb6.css
    }
    checked for all supporting OS similar to above one and rendering css with loadCss method. loadCss method code :


    function loadCss(filename) {
    var css = document.createElement('link');
    css.rel = "stylesheet";
    css.type = "text/css";
    css.href = filename;
    document.getElementsByTagName('head')[0].appendChild(css);
    }

    Hope this helps.


    Thanks

  3. #2
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    27
    Vote Rating
    0
    Answers
    1
    janardhan pasumarthi is on a distinguished road

      0  

    Default Solved loading device specific css in sencha touch

    Solved loading device specific css in sencha touch


    Hi All,


    I've achieved this by checking Os name and loading the corresponding css file which is provided by sencha. Code looks like below:


    if( Ext.os.is( OSNAME.BLACKBERRY ) ) {

    loadCss( OSNAME.BLACKBERRY_CSS_URL ); // css url will be like touch/resources/css/bb6.css
    }
    checked for all supporting OS similar to above one and rendering css with loadCss method. loadCss method code :


    function loadCss(filename) {
    var css = document.createElement('link');
    css.rel = "stylesheet";
    css.type = "text/css";
    css.href = filename;
    document.getElementsByTagName('head')[0].appendChild(css);
    }

    Hope this helps.


    Thanks

  4. #3
    Sencha User
    Join Date
    Jan 2011
    Posts
    27
    Vote Rating
    1
    Ohmz is on a distinguished road

      0  

    Default


    Now how can we do this using CMD while building for different devices, without having to manually adjust app.json each time?