成都创新互联网站制作重庆分公司

android安卓onCreate方法中获取控件宽度高度

ViewTreeObserver vto = p_w_picpathView.getViewTreeObserver();   

创新互联2013年至今,先为六盘水等服务建站,六盘水等地企业,进行企业商务咨询服务。为六盘水企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

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();

}

});


当前文章:android安卓onCreate方法中获取控件宽度高度
文章位置:http://cxhlcq.com/article/jjehih.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部