混淆"最小宽度600 DP"选择 [英] Confusion with "smallest width 600 dp" selector

查看:624
本文介绍了混淆"最小宽度600 DP"选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的申请,我支持手机/平板电脑的外形,并有单独的布局我用选择布局(用于手机),布局sw600dp(平板电脑)。

In my application I am supporting phone/tablet form factors and to have individual layouts I use selector "layout" (for phones), "layout-sw600dp" (for tablets).

以下是详细内容:

http://android-developers.blogspot.in/2011/07/new-tools-for-managing-screen-sizes.html

Typical numbers for screen width dp are:
320: a phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480: a tweener tablet like the Streak (480x800 mdpi).
600: a 7" tablet (600x1024).
720: a 10" tablet (720x1280, 800x1280, etc).

我有一个的Nexus 4手机,下面是它的attirbutes

I am having a Nexus 4 mobile, following are its attirbutes

Size:       4.7 inches
Resolution: 768 x 1280 pixels
DPI:        318
dp:         386 
Here is the dp calculation
dp = (px * 160)/dpi
dp = (768 * 160)/318

当我在DP计算公式使用768像素的DP值当属386,但是当我通过1280像素的DP值当属644

When I use 768 px in dp calculation formula the dp value comes as 386, but when I pass 1280 px the dp value comes as 644.

通过以​​下几点认识我考虑的Nexus 4的景观,将读sw600dp布局,但事实并非如此。

With the following understanding I thought for Nexus 4 landscape it would read the layout from sw600dp, but that's not the case.

由于分辨率是宽度x高度,它将被当设备旋转逆转。

我认为这是SW选择器的即兴比较pre-3.2大,超大的部门。

I thought this is the improvisation made with sw selectors compare to pre-3.2 large, xlarge sectors.

推荐答案

由于它的Andr​​oid文档<一说中href=\"http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts\">here粗体(有点向下滚动到表2的最小宽度部分):

As it says in the Android documentation here in bold (scroll down a bit to the "smallestWidth" section of Table 2):

的最小宽度是该装置的固定屏幕大小特性;
  设备的smallestWidth不会改变的时候,屏幕的
  方向的变化

The smallestWidth is a fixed screen size characteristic of the device; the device's smallestWidth does not change when the screen's orientation changes.

这篇关于混淆&QUOT;最小宽度600 DP&QUOT;选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆