glide scaletype 无效,在ImageView Android中使用Glide调整图像大小

I have a lot of doubts about the treatment of the images in android, and I was hoping to see if you could solve them.

At this point I have an image that occupies 320 dp high, and match_parent width, which is around 60% of the screen.

This image of the load with Glide, of some images in 1080 that I have personally.

I tried to make centroCrop and fitXY, but always deform the images. The first type I know cuts the image, but the second one fits a size, but it does deform the image high or wide.

Is there any way, to insert it with Glide and see it as it is?

What properties have I to touch on ImageView and which of Glide?

android:id="@+id/img"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:nestedScrollingEnabled="false"

app:layout_collapseMode="parallax"

android:scaleType="fitXY"

app:layout_scrollFlags="scroll|enterAlways" />

Thanks in advance.

解决方案

Elletlar comment:

Override must be accessed via RequestOptions in the most recent version of Glide.

Glide

.with(context)

.load(path)

.apply(new RequestOptions().override(600, 200))

.into(imageViewResizeCenterCrop);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值