首页 > 移动平台 > 详细

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

时间:2016-10-10 16:52:15      阅读:267      评论:0      收藏:0      [点我收藏+]

ViewTreeObserver vto = imageView.getViewTreeObserver();   

vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {

public void onGlobalLayout() {

imageView.getViewTreeObserver().removeGlobalOnLayoutListener(this); 

int height=imageView.getHeight();

int width =imageView.getWidth();

}

});


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

原文:http://11020803.blog.51cto.com/11010803/1860236

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!