在initView中,获取控件的真实的高,有2种方法:
第1种:
主动通过measure方法,去触发测量方法;
然后getMeasuredHeight()
如图:
第2种:
是onLayout完成后,调用getHeight
在initView中,获取控件的真实的高,有2种方法:
第1种:
主动通过measure方法,去触发测量方法;
然后getMeasuredHeight()
如图:
第2种:
是onLayout完成后,调用getHeight