Android Screen sizes

前端 未结 8 1472
野性不改
野性不改 2020-12-02 23:30

I need to know the screen sizes of android devices to support multiple screen sizes application.

8条回答
  •  温柔的废话
    2020-12-03 00:18

    Different screen sizes are as follows.

    xlarge screens are at least 720dp 960dp
    large screens are at least 480dp x 640dp
    normal screens are at least 320dp x 470dp
    small screens are at least 320dp x 426dp
    

    If you are plan to make an application which support for multiple devices, also you have to crate different layout directories for put different layouts.

    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
    

    If you are plan to add different sizes of images, put them in following folders accordingly. Android OS will automatically take the most suitable image out of them.

    res/drawable-ldpi/my_icon.png        // bitmap for low density
    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
    

    enter image description here

提交回复
热议问题