Results 1 to 3 of 3

Thread: adjusting layout as per screen size

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    35
    Vote Rating
    0
      0  

    Default adjusting layout as per screen size

    Hi,

    I am new to sencha touch. I am working on a web app and when I view in a bigger size android phone items in the layout appear fine but when I view it in iPhone layout is not adjusted as per phone size and items go out of the screen .
    please suggest how to handle this.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    In initComponent, set the layout property based on your criteria.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    35
    Vote Rating
    0
      0  

    Default

    Hi,

    Sorry but I did not understood what I should do. I tried

    Code:
    profiles: {
          phoneBlackberry: function() {
          return Ext.is.Blackberry;
          },
          phoneAndroid: function() {
          return Ext.is.Android;
          },
          phoneApple: function() {
          return Ext.is.iOS;
          },
          desktop: function() {
          return Ext.is.Desktop;
          },
          tabletPortrait: function() {
          return Ext.is.Tablet && Ext.orientation == 'portrait';
          },
          tabletLandscape: function() {
          return Ext.is.Tablet && Ext.orientation == 'landscape';
          }
          }
    but this had no difference. Please advice what should be my criteria . Is it the screen size but then there are so many devices around with different sizes and accordingly what layout property should I set.
    I was expecting with
    Code:
    layout: {
                type: 'vbox',
                align: 'center',
                pack: 'top',
                autoScroll: true,
                 },
    I should get layout centered irrespective of screen size.
    How to handle this. Please advice.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •