Search code examples
androidandroid-layoutandroid-relativelayoutscreen-size

How to make layout for diffrent screen sizes using Relative Layout for Android


I have coded the whole app and designed all the layouts in Relative Layout, but now I want to make it compatible with all the screen sizes.


Solution

  • I would recommend using the percent relative layout

    It offers the following attributes which you can use to set dimensions accordingly.

    • layout_widthPercent
    • layout_heightPercent
    • layout_marginPercent
    • layout_marginLeftPercent

    etc.