这个方法是转变为标准尺寸的一个函数,例如

int size = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20, context.getResources().getDisplayMetrics());

这里COMPLEX_UNIT_DIP是单位,20是数值,也就是20dp。

相关文章:

  • 2021-06-25
  • 2021-10-24
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案