【问题标题】:How to blur a view or layout in android?如何在android中模糊视图或布局?
【发布时间】:2016-11-28 04:37:33
【问题描述】:

我正在尝试像下面的示例一样模糊视图或布局。到目前为止,我只看到了模糊图像的示例,我对如何在布局上实现模糊感到困惑。希望大家帮忙!

干杯!

【问题讨论】:

标签: android android-layout material-design android-xml blur


【解决方案1】:

试试这个Library,它既美观又易于使用。

设置

依赖关系

dependencies {
compile 'jp.wasabeef:blurry:2.0.3'
}

功能

叠加

父级必须是 ViewGroup

Blurry.with(context).radius(25).sampling(2).onto((ViewGroup) rootView);

进入

Blurry.with(context).capture(view).into(imageView);

模糊选项

  • 半径
  • 下采样
  • 彩色滤光片
  • 异步支持
  • 动画(仅覆盖)

Blurry.with(context)
.radius(10)
.sampling(8)
.color(Color.argb(66, 255, 255, 0))
.async()
.animate(500)
.onto(rootView);

输出:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-26
    • 2021-05-23
    • 2013-01-24
    • 2012-07-14
    • 2016-04-14
    • 2014-02-09
    • 1970-01-01
    相关资源
    最近更新 更多