Android XML Layout for all Devices (Small/Normal/Large/XLarge, etc)

前端 未结 3 408
[愿得一人]
[愿得一人] 2020-12-23 15:36

I want to create a XML Layout that will support all the Screen sizes. In the XML, first element is ImageView, second one is TextView and third one

3条回答
  •  星月不相逢
    2020-12-23 15:58

    So you need to create different folders and maintain all xml in those folders.

    The following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for medium, high, and extra high density screens.

    res/layout/my_layout.xml             // layout for normal screen size ("default")
    res/layout-small/my_layout.xml       // layout for small screen size
    res/layout-large/my_layout.xml       // layout for large screen size
    res/layout-xlarge/my_layout.xml      // layout for extra large screen size
    res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
    

    For more info refer this link

提交回复
热议问题