yangshuang0

获取分辨率信息的获取DisplayMetries对象


WindowManager wm = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
return dm.widthPixels;//获取宽度
  //return dm.heightPixels;//获取高度
   //return dm.density;//获取像素密度



分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-09-16
  • 2022-12-23
  • 2021-12-19
猜你喜欢
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-01-08
  • 2021-04-01
相关资源
相似解决方案