android中DisplayMetrics类的作用

DisplayMetrics类的用法及功能:用来获取的屏幕分辨率

android.util.DisplayMetrics
To access the DisplayMetrics members, initialize an object like this:
要想访问显示界面元素,需要初始化这样一个对象
 DisplayMetrics metrics = new DisplayMetrics();
 getWindowManager().getDefaultDisplay().getMetrics(metrics);

Summary
Constants 常量:
int DENSITY_DEFAULT The reference density used throughout the system.
默认的密度:整个系统中使用的参考密度
int DENSITY_HIGH Standard quantized DPI for high-density screens.
高密度: 为高密度屏幕标准量化的分辨率
int DENSITY_LOW Standard quantized DPI for low-density screens.
低密度:低密度屏幕标准量化的分辨率
int DENSITY_MEDIUM Standard quantized DPI for medium-density screens.
中低密度:中等密度标准量化的分辨率
int DENSITY_TV Standard quantized DPI for 720p TV screens.
电视密度:720p电视屏幕标准量化分辨率
int DENSITY_XHIGH Standard quantized DPI for extra-high-density screens.
超高密度:超高密度屏幕量化标准的分辨率

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值