scrollView中设置ImageView大小

Imagview设置:

Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(mContext.getResources(), R.drawable.buy_product,options);

线性布局设置:

LinearLayout.LayoutParams params0 = (LayoutParams) ll0.getLayoutParams();
params0.height = options.outHeight;
ll0.setLayoutParams(params0);

你可能感兴趣的:(imageview)