系统默认的size和density

来源:互联网 发布:互刷流量软件 编辑:程序博客网 时间:2024/06/03 12:30

参考文档路径 

http://developer.android.com/intl/zh-cn/guide/practices/screens_support.html#support

系统默认的size和density

size normal

density medium-density mdpi


If no matching resource is available, the system uses the default resource and scales it up or down as needed to match the current screen size and density

The "default" resources are those that are not tagged with a configuration qualifier. For example, the resources in drawable/ are the default drawable resources. The system assumes that default resources are designed for the baseline screen size and density, which is a normal screen size and a medium-density. As such, the system scales default density resources up for high-density screens and down for low-density screens, as appropriate.

However, when the system is looking for a density-specific resource and does not find it in the density-specific directory, it won't always use the default resources. The system may instead use one of the other density-specific resources in order to provide better results when scaling. For example, when looking for a low-density resource and it is not available, the system prefers to scale-down the high-density version of the resource, because the system can easily scale a high-density resource down to low-density by a factor of 0.5, with fewer artifacts, compared to scaling a medium-density resource by a factor of 0.75.

Table 1. Configuration qualifiers that allow you to provide special resources for different screen configurations.

Screen characteristicQualifierDescriptionSizesmallResources for small size screens.normalResources for normal size screens. (This is the baseline size.)largeResources for large size screens.xlargeResources for extra-large size screens.DensityldpiResources for low-density (ldpi) screens (~120dpi).mdpiResources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)hdpiResources for high-density (hdpi) screens (~240dpi).xhdpiResources for extra-high-density (xhdpi) screens (~320dpi).xxhdpiResources for extra-extra-high-density (xxhdpi) screens (~480dpi).xxxhdpiResources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi). Use this for the launcher icon only, see note above.nodpiResources for all densities. These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.tvdpiResources for screens somewhere between mdpi and hdpi; approximately 213dpi. This is not considered a "primary" density group. It is mostly intended for televisions and most apps shouldn't need it—providing mdpi and hdpi resources is sufficient for most apps and the system will scale them as appropriate. If you find it necessary to provide tvdpi resources, you should size them at a factor of 1.33*mdpi. For example, a 100px x 100px image for mdpi screens should be 133px x 133px for tvdpi.OrientationlandResources for screens in the landscape orientation (wide aspect ratio).portResources for screens in the portrait orientation (tall aspect ratio).Aspect ratiolongResources for screens that have a significantly taller or wider aspect ratio (when in portrait or landscape orientation, respectively) than the baseline screen configuration.notlongResources for use screens that have an aspect ratio that is similar to the baseline screen configuration.
0 0
原创粉丝点击