在我之前对我国十大手机和平板电脑进行研究后,我可以将它们分类如下:
HANDSETS:
533dp x 320dp
640dp x 360dp
853dp x 480dp
TABLETS:
1280dp x 800dp
960dp x 600dp
因此,鉴于我支持API级别11及以上,我将需要包括指定布局和新布局的旧方法。因此,对于旧版本,我的布局将如下所示:
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
<< and the corresponding landscape >>
sw<N>dp
的新版本看起来像这样(对于手机):
res/layout-sw320dp/my_layout.xml
res/layout-sw360dp/my_layout.xml
res/layout-sw480dp/my_layout.xml
<< and the landscape >>
res/layout-sw320dp-land/my_layout.xml
res/layout-sw360dp-land/my_layout.xml
res/layout-sw480dp-land/my_layout.xml
所以,问题如下:
426dp x 320dp
和470dp x 320dp
列为正确的屏幕尺寸示例。我有一个相当奇怪的533dp x 320dp
。我在计算DP大小时出错了吗?