本文介绍了如何在android中模糊视图或布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图像下面的示例那样模糊视图或布局.到目前为止,我仅看到模糊图像的示例,并且对如何在布局上实现模糊感到困惑.希望你们能帮忙!
I'm trying to blur a view or layout like the example i have below. So far I have only seen examples of bluring images and im confused on how to implement a blur on a layout. I hope you guys can help!
干杯!
推荐答案
尝试一下图书馆的好处是简单易用.
Try this Library its nice and simple to use.
dependencies {
compile 'jp.wasabeef:blurry:2.0.3'
}
功能
重叠
父级必须是ViewGroup
Functions
Overlay
Parent must be ViewGroup
Blurry.with(context).radius(25).sampling(2).onto((ViewGroup) rootView);
进入
Blurry.with(context).capture(view).into(imageView);
模糊选项
- 半径
- 下采样
- 滤色器
- 异步支持
- 动画(仅覆盖)
- Radius
- Down Sampling
- Color Filter
- Asynchronous Support
- Animation (Overlay Only)
Blur Options
Blurry.with(context)
.radius(10)
.sampling(8)
.color(Color.argb(66, 255, 255, 0))
.async()
.animate(500)
.onto(rootView);
输出:
这篇关于如何在android中模糊视图或布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!