int w = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED);
indexIBtn.measure(w, h); //indexIBtn 为控件对象
int width =indexIBtn.getMeasuredWidth();
int height =indexIBtn.getMeasuredHeight();
android 获取 控件的大小
最新推荐文章于 2024-04-09 01:13:04 发布