以下是可以用来为不同的屏幕尺寸、像素密度和纵横比包含可替换资源的文件夹名称限定符
1、屏幕尺寸 small 小于标准的3.2“的屏幕
medium 典型的智能手机的屏幕尺寸
large 比典型的智能手机的屏幕大得多的屏幕,比如平板电脑和上网本
2、像素密度 像素密度通常是用每英寸点数来计算
ldpi 用于为像素密度在100~140dpi之间的屏幕存储低密度资源
mdpi 用于像素密度在140~180dip之间的中等密度的屏幕
hdpi 用于像素密度在190~250dip之间的高密度的屏幕
nodpi 用于不管屏幕密度如何,都不能伸缩的资源
3、纵横比 屏幕的纵横比就是其高度和宽度的比率
long 用于横向模式的宽度比标准智能手机(如G1)的宽度大得多的屏幕
notlong 用于具有典型智能手机的纵横比的屏幕
具体描述如下表格:
每个限定符可以单独使用也可以和其他限定符一起使用
如 res/layout-small-long //小而长的屏幕的布局
res/layout-large //大屏幕的布局
res/drawable-hdpi //高密度屏幕的 Drawable
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
Tip: If you have some drawable resources that the system should never scale (perhaps because you perform some adjustments to the image yourself at runtime), you should place them in a directory with the nodpi
configuration qualifier. Resources with this qualifier are considered density-agnostic and the system will not scale them.
附:通过<supports-screens android:smallScreens="false" android:normalScreens="true" android:largeScreens="true" android:anyDensity="true"/>清单可以控制指定应用程序在哪些屏幕下运行
Declaring Tablet Layouts for Android 3.2
smallestWidth(宽和高中比较小 的长度要比<N>大) |
sw<N>dp Examples: sw600dp sw720dp
|
The fundamental size of a screen, as indicated by the shortest dimension of the available screen area. Specifically, the device's smallestWidth is the shortest of the screen's available height and width (you may also think of it as the "smallest possible width" for the screen). You can use this qualifier to ensure that, regardless of the screen's current orientation, your application's has at least For example, if your layout requires that its smallest dimension of screen area be at least 600 dp at all times, then you can use this qualifer to create the layout resources, The smallestWidth of a device takes into account screen decorations and system UI. For example, if the device has some persistent UI elements on the screen that account for space along the axis of the smallestWidth, the system declares the smallestWidth to be smaller than the actual screen size, because those are screen pixels not available for your UI. This is an alternative to the generalized screen size qualifiers (small, normal, large, xlarge) that allows you to define a discrete number for the effective size available for your UI. Using smallestWidth to determine the general screen size is useful because width is often the driving factor in designing a layout. A UI will often scroll vertically, but have fairly hard constraints on the minimum space it needs horizontally. The available width is also the key factor in determining whether to use a one-pane layout for handsets or multi-pane layout for tablets. Thus, you likely care most about what the smallest possible width will be on each device. |
Available screen width (宽度至少要比<N>大) |
w<N>dp Examples: w720dp w1024dp
|
Specifies a minimum available width in dp units at which the resources should be used—defined by the This is often useful to determine whether to use a multi-pane layout, because even on a tablet device, you often won't want the same multi-pane layout for portrait orientation as you do for landscape. Thus, you can use this to specify the minimum width required for the layout, instead of using both the screen size and orientation qualifiers together. |
Available screen height
(高度至少要比<N>大)
|
h<N>dp Examples: h720dp h1024dp etc. |
Specifies a minimum screen height in dp units at which the resources should be used—defined by the Using this to define the height required by your layout is useful in the same way as |
To help you target some of your designs for different types of devices, here are some numbers for typical screen widths:
- 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
- 480dp: a tweener tablet like the Streak (480x800 mdpi).
- 600dp: a 7” tablet (600x1024 mdpi).
- 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
Caution: When developing for Android 3.2 and higher, you should not use the older screen size attributes in combination with the attributes listed above. Using both the new attributes and the older size attributes might cause unexpected behavior.
相关推荐
android适配宽高限定符生成程序,具体操作流程详见压缩包
Android的Fragment+限定符适配手机和平板。在这个Demo中,为了方便,我通过修改限定符来测试效果的。修改layout-sw400dp的数值。
整型(int、long int 、short等)下十进制、八进制、十六进制的输入输出控制符
C存储类分为两类:自动存储类(automatic)和静态存储类(static)。 声明对象时使用的存储类说明... (1) 如果没有使用存储类说明符,或者如果使用了auto限定符,则程序块中的声明生成的都是自动存储类对象。………………
android资源限定符Excel 博文链接:https://vvlavida.iteye.com/blog/1953123
const限定符的使用,以及const 与 #define 的区别
android 的宽高限定符适配
java成员变量和方法的public等访问限定符的访问权限.doc
指的是Android会识别屏幕可用高度和宽度的最小尺寸的dp值(其实就是手机的宽度值),然后根据识别到的结果去资源文件中寻找对应限定符的文件夹下的资源文件。 效果图展示 LICENSE Copyright 2018 Vension Licensed ...
Python 正则式表达 04重复数量限定符.mp4
关于C语言中类型限定符const的研究.pdf
Python 正则式表达 05重复数量限定符的使用.mp4
const限定符 const是一种限定符,被const所限定的变量其值不可以被改变。 const的初始化 由于const一旦创建其值就不能够被改变,所以我们必须对其进行初始化 const int a;//错误,const变量必须进行初始化! const ...
主要介绍了c++ primer中的const限定符,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
固定-固定:CSS position:fixed限定符 (c)2012 @scottjehl,细丝集团 双重许可:MIT和/或GPLv2 解释 CSS固定位置在浏览器支持上差异很大,并且很难测试。 此存储库包含一个测试,该测试试图限定CSS position:fixed...
java笔试题a说他不和x比迪特编程语言 ...)的顺序类型限定符在类型表达式中给出无关紧要:如果beefy和gnarly是类型限定符,那么beefy gnarly int和gnarly beefy int是完全等效的类型。 出现的次数也不重
2.7 完成TIME矸渔CKER 2.8 结束语 第3章 更进一步 3.1支持多种屏幕尺寸 3.1.1 资源限定符 3.1.2 资源限定符优先级 3.1.3 密度无关的像素 3.1.4 9.补丁图形 3.2处理通知 3.2.1 TOAST 3.2.2 状态栏通知 3.2.3 对话框 ...
用ecshop做外贸系统,或者做特定的产品网站,针对某一国家或者地区,不想该地区用户访问,采用IP地址、IP段、国家、地区多重验证手段指定限制。同时支持黑名单和白名单功能。 演示截图:www.ecshop.cx/demo-315.html
使用资源限定符来更改在不同屏幕尺寸中使用的布局。 使用资源限定符来更改在不同屏幕密度下使用的布局。 使用资源限定符在不同的 Android 版本中更改布局。 如何使用样式和主题。 如何在同一活动中交流片段。 ...