Android Tutorial [Tool] Enhance your layouts with the "Layout bounds" developer option

Discussion in 'Tutorials & Examples' started by fredo, Feb 25, 2019.

  1. fredo

    fredo Well-Known Member Licensed User

    The creation of layouts is very easy with the B4A Designer.

    With more complex forms, however, it can happen that the result looks a bit weird. Usually the heights or distances between the labels are different, but this is not immediately noticeable during development.

    To avoid slowing down productivity with time-consuming adjustment and control, Android has a helpful tool in the developer options: "Show layout bounds".

    The use during development is easiest via a Quick tile (4).

    Activation of the tile:
    (1) Developer Options ON
    (2) quick settings developer tiles
    (3) Show layout bounds​


    All user interface elements will be marked with their borders (5).
    Now it is possible to achieve a pixel-precise arrangement of the elements.

    A further tool then might help with the exact analysis of the distances:
  2. GMan

    GMan Well-Known Member Licensed User

    Is this for AndroidStudio Users only ?
  3. fredo

    fredo Well-Known Member Licensed User

    Nope, it's purely on the device.

    Every Android from Marshmallow up should support it.
  4. AnandGupta

    AnandGupta Active Member Licensed User

    Thanks a lot fredo, for the information :)

    I found that it is also available in titles (more). This is great help for checking the design of a running app, even other's apps to get the idea.

    Also found under 'Developer', 'show taps' and 'pointer location', which are also very useful. Only there is no titles for them, to quickly enable/disable.

    Redmi 4 ver 10.1, Android 7.1


    fredo likes this.
  5. rraswisak

    rraswisak Active Member Licensed User

    hi... i have try this on my device with app created with b4a, it's seem perfect just like how it looks in designer
  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