通过如下方法获取宽高:
int width = v.getMeasuredWidth();
int height = v.getMeasuredHeight();
一、重写Activity的onWindowFocusChanged方法(当view布局完成后会触发此方法):
public void onWindowFocusChanged(boolean hasFocus){super.onWindowFocusChanged(hasFocus);
int width = v.getMeasuredWidth();
int height = v.getMeasuredHeight();
}