本文介绍了如何在Android中模糊背景图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
模糊背景图片的最佳方法是什么,如下图所示?我看到了一些代码和库,但它们已经有几年的历史了,或者像BlurBehind库一样,但它没有给出相同的效果。提前致谢!
What is the best way to blur background images like the image below? I saw some code and libraries but their are a couple of years old or like BlurBehind library, but it doesn't give the same effect. Thanks in advance!
推荐答案
最简单的方法是使用库。看看这个:
The easiest way to do that is use a library. Take a look at this one: https://github.com/wasabeef/Blurry
使用图书馆你只需要这样做:
With the library you only need to do this:
Blurry.with(context)
.radius(10)
.sampling(8)
.color(Color.argb(66, 255, 255, 0))
.async()
.onto(rootView);
这篇关于如何在Android中模糊背景图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!