android安卓onCreate方法中获取控件宽度高度
ViewTreeObserver vto = p_w_picpathView.getViewTreeObserver();
vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
public void onGlobalLayout() {
p_w_picpathView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
int height=p_w_picpathView.getHeight();
int width =p_w_picpathView.getWidth();
}
});
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。