android – View类的onMeasure(int widthMeasureSpec,int heightMeasureSpec)方法的参数值单位是多少?

android – View类的onMeasure(int widthMeasureSpec,int heightMeasureSpec)方法的参数值单位是多少?,第1张

概述可以任何身体让我知道参数单位是什么  onMeasure(int widthMeasureSpec,int heightMeasureSpec)此View类方法. 我打印日志分别返回1073742144,-2147483251. 该值是模式和大小的组合.使用View.MeasureSpec.getMode(widthMeasureSpec)获取模式(MeasureSpec.EXACTLY,Mea 可以任何身体让我知道参数的单位是什么
onMeasure(int wIDthMeasureSpec,int heightmeasureSpec)此VIEw类方法.

我打印日志分别返回1073742144,-2147483251.

@H_419_6@解决方法 该值是模式和大小的组合.使用VIEw.MeasureSpec.getMode(wIDthMeasureSpec)获取模式(MeasureSpec.EXACTLY,MeasureSpec.AT_MOST和MeasureSpec.UnspecIFIED之一);您可能想知道的是VIEw.MeasureSpec.getSize(wIDthMeasureSpec),大小(以像素为单位).

另见source code of MeasureSpec.

总结

以上是内存溢出为你收集整理的android – View类的onMeasure(int widthMeasureSpec,int heightMeasureSpec)方法的参数值单位是多少?全部内容,希望文章能够帮你解决android – View类的onMeasure(int widthMeasureSpec,int heightMeasureSpec)方法的参数值单位是多少?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1130282.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存