int w = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); int h = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); //view为你想获取信息的控件 tv_pic_tips.measure(w, h); //获取的宽度 int width =tv_pic_tips.getMeasuredWidth();
int height =tv_pic_tips.getMeasuredHeight();