Folder name for 7" hdpi tablet Android

前端 未结 3 1848
旧时难觅i
旧时难觅i 2020-12-02 01:32

I have Tablet with 7\" screen (600×1024) with hdpi (240 dpi classification).

I have created folder layout-sw600dp. But it\'s not working in this resolut

3条回答
  •  醉话见心
    2020-12-02 02:03

    In android, we use resolution in dp to measure the screen size, not resolution in px. Both of your two tablets have the same resolution in px, but their resolution in dp are quite different.

    1. 600 X 1024px with mdpi = 600 * 1024 dp

    2. 600 X 1024px with hdpi = 400 * 682 dp

    You use sw600dp as the qualifier for tablet, which will effect the first device but not the second one.

    In fact, the second device(400 * 682dp), is much more like a handset rather than a tablet, it should not use the layout for tablet.

提交回复
热议问题