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://csdahua.cn/article/jjehih.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流