getWidth(): View在设定好布局后整个View的宽度。
  getMeasuredWidth(): 对View上的内容进行测量后得到的View内容占据的宽度,前提是你必须在父布局的onLayout()方法或者此View的onDraw()方法里调用measure(0,0);(measure 参数的值你可以自己定义),否则你得到的结果和getWidth()得到的结果一样

相关文章:

  • 2021-11-22
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-08-21
  • 2021-12-26
  • 2022-02-14
猜你喜欢
  • 2021-10-26
  • 2021-09-29
  • 2022-12-23
  • 2021-07-02
  • 2021-12-14
相关资源
相似解决方案