Multiple screen support do we need different layouts for each screen

前端 未结 4 1190
温柔的废话
温柔的废话 2020-12-10 23:42

For Multiple screen support do we need different layouts for each screen which goes in hdpi, ldpi and mdpi folders, I read this on android site, but not sure how to implemen

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 23:50

    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
    
    res/drawable-mdpi/my_icon.png        // bitmap for medium density
    res/drawable-hdpi/my_icon.png        // bitmap for high density
    res/drawable-xhdpi/my_icon.png       // bitmap for extra high density
    

    This information are already given at Android developer site: http://developer.android.com/guide/practices/screens_support.html

    Alternative drawables => Screen densities:

    enter image description here

提交回复
热议问题