Android Image查看拉伸问题

时间:2018-01-30 11:59:24

标签: java android image picasso android-glide

我正在开展一个项目。在那,我使用ImageView来显示来自网址和本地的图像。在该图像中没有正确显示。我试图更改fitXY,中心裁剪的比例属性但不能正常工作。

可以根据我的ImageView高度和宽度更改图像高度和宽度,而不会影响图像质量。或任何其他方式来解决这个问题。

3 个答案:

答案 0 :(得分:0)

尝试adjustViewBounds。

<ImageView
     android:layout_width="match_content"
     android:layout_height="wrap_content"
     android:src="@mipmap/ic_launcher"
      android:adjustViewBounds="true"
     />

答案 1 :(得分:0)

如果你想使用ImageView Scale Type,这里有一些视觉指导。 Click Here

如果您在从网址获取图片时遇到问题 使用毕加索图书馆。要安装毕加索: 在您的Gradle文件中添加此依赖项:compile 'com.squareup.picasso:picasso:2.5.2'

用于从网络加载图片:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

答案 2 :(得分:0)

在imageview中设置属性android:adjustViewBounds="true"

相关问题