先测量一下,再获取 imgMain.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int width = (int)(imgMain.getMeasuredWidth());
先测量一下,再获取 imgMain.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int width = (int)(imgMain.getMeasuredWidth());