组件内容模糊 (系统接口)

为当前组件添加内容模糊效果。

说明:

从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。

当前页面仅包含本模块的系统接口,其他公开接口参见组件内容模糊

BlurStyleOptions

名称 参数类型 必填 描述
scale number 内容模糊效果程度。此参数为系统接口。
默认值:1.0
取值范围:[0.0, 1.0]

示例

// xxx.ets
@Entry
@Component
struct ForegroundBlurStyleDemo {
  build() {
    Column() {
      Text('Thin Material').fontSize(30).fontColor(0xCCCCCC)
      Image($r('app.media.bg'))
        .width(300)
        .height(350)
        .foregroundBlurStyle(BlurStyle.Thin, { colorMode: ThemeColorMode.LIGHT, adaptiveColor: AdaptiveColor.DEFAULT, scale: 1.0 })
    }
    .height('100%')
    .width('100%')
  }
}

zh-cn_image_background_blur_style