【问题标题】:Is it possible to make an image centerInside with a blurred background with glide library?是否可以使用 glide 库制作背景模糊的图像 centerInside?
【发布时间】:2018-04-17 06:05:40
【问题描述】:

我熟悉 Glide 中的 fitcenter 和 centercrop。但是有没有可能制作出像这样的图像

有什么想法可以实现吗?

【问题讨论】:

  • 我认为它们是 2 个不同的图像视图,一个在另一个之上。底部加载主图像的模糊/拇指版本,在顶部图像视图上以高分辨率显示
  • 是的,我们可以这样实现。但需要 2 个 ImageView。

标签: android android-imageview android-glide image-scaling


【解决方案1】:

使用两个 imageView。一个更小,在另一个之上。然后使用这个library 并使用这段代码作为背景图片

Glide.with(this).load(R.drawable.demo)
  .apply(bitmapTransform(new BlurTransformation(25)))
  .into((ImageView) findViewById(R.id.image));

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-30
    相关资源
    最近更新 更多