如何在 Android 上获得模糊效果?

How do I get the blur effect on Android?

我必须提供像图片中那样的背景模糊效果。

第一层包含文本,switch.There 是下面的另一层 it.The 此层颜色的属性:#f8f8f8 alpha: 82.The 实际颜色存在于下方 layer.True 图片中的颜色是 #D42E2E.These 层可能在下面的图片中看起来更好。

如何在不使用外部库的情况下完成此操作?

这看起来像一个 渐变 作为背景,中心颜色为浅红色,边框颜色为白色。

您可以使用此 Gradient Generator 来创建渐变。例如,将渐变代码保存在您的绘图文件夹中 gradient.xml 并将其用作视图的背景。

这可能是你的渐变

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<gradient
android:type="linear"
android:centerX="50%"
android:startColor="#FFFFFFFF"
android:centerColor="#FFFF8A8A"
android:endColor="#FFFFFFFF"
android:angle="90"/>
</shape>

结果: