Android ImageView 自动拉伸

1 int width = ScreenUtils.getScreenWidth(this);
2 int height = ScreenUtils.getScreenHeight(this);
3 mImageView = new ImageView(this);
4 mImageView.setScaleType(ImageView.ScaleType.FIT_XY);
5 mImageView.setLayoutParams(new Gallery.LayoutParams(width, height));// 设置Gallery组件的背景风格
1 ViewGroup.LayoutParams params = mImageView.getLayoutParams();
2 //设置图片的相对于屏幕的宽高比
3 params.width = width;
4 params.height = height;
5 mImageView.setLayoutParams(params);

 

Android ImageView 自动拉伸

上一篇:工具类(过滤接口空值, value 或 空字符串) - iOS


下一篇:Android清空Fragment回退栈