首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

在onCreate的时分就获得View的尺寸

2012-07-01 
在onCreate的时候就获得View的尺寸Log.d(TAG, String.format(%d, %d, view.getMeasuredWidth(), view.

在onCreate的时候就获得View的尺寸

Log.d("TAG", String.format("%d, %d", view.getMeasuredWidth(), view.getMeasuredHeight()));view.measure(0, 0);Log.d("TAG", String.format("%d, %d", view.getMeasuredWidth(), view.getMeasuredHeight()));


输出结果:
0, 0
xx, xx

热点排行