Android Question Confused about AutoScale(All) - How to use?

Discussion in 'Android Questions' started by doncx, Sep 10, 2015.

  1. doncx

    doncx Member Licensed User

    I developed an app specifically for the Nexus 10 a couple of years ago (2560x1600 resolution). Now the client wants to run it on Nexus 9 (2048x1536 resolution).

    The app is over-sized on the smaller Nexus 9 and also doesn't rotate properly.

    The original screens in designer are made to a custom size: 752x1280 and 1280x752.

    I've tried AutoScaleAll and several AutoScaleRates (from 0.1 to 1) in the All Variants script. They all seem to be ignored and the Nexus 9 screen is still over-sized and won't rotate. I should say, it rotates but does not select the proper variant.

    What do I need to do to make it work properly? I'm using B4A 4.30.

    My thanks for your advice
  2. Erel

    Erel Administrator Staff Member Licensed User

    "2560x1600 resolution" in Android is meaningless without the scale.

    AutoScaleAll will not take care of fitting all the views. All it does is slightly increases or decreases the views sizes. You need to use anchors and designer script to implement a flexible layout.
  3. doncx

    doncx Member Licensed User

    I do use anchors and in some cases script to center and give widths.

    Are you saying that every dimension of every view must be scripted?

    Images attached.

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User


    For most views anchors will be enough. Note that it is easier to create a smaller variant that "grows".
  5. doncx

    doncx Member Licensed User

    Thanks, Erel. I followed your advice and it was good, of course. I do have several very tightly laid out, button-filled screens and found that specifying top,left, width, and height in percentages for each and every view was the best way to preserve these. Otherwise, going small and counting on AutoScale was indeed very effective.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice