scrollView中设置ImageView大小

来源:互联网 发布:提高数据分析能力 编辑:程序博客网 时间:2024/04/30 20:00

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);
0 0
原创粉丝点击