/**
* 获取组件高度(宽度)
*
* @param view
* @return
*/
public static int getHeight(View view)
{
int w = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
view.measure(w, h);
return view.getMeasuredHeight();
}
* 获取组件高度(宽度)
*
* @param view
* @return
*/
public static int getHeight(View view)
{
int w = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
int h = View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED);
view.measure(w, h);
return view.getMeasuredHeight();
}