harmony 鸿蒙组件内容模糊
组件内容模糊
为当前组件添加内容模糊效果。
说明:
从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
属性
| 名称 | 参数类型 | 描述 | 
|---|---|---|
| foregroundBlurStyle | value:BlurStyle, options?:ForegroundBlurStyleOptions  | 
为当前组件提供内容模糊能力。 value: 内容模糊样式。模糊样式由模糊半径、蒙版颜色、蒙版透明度、饱和度、亮度五个参数组成。 options: 可选参数,内容模糊选项。  | 
ForegroundBlurStyleOptions对象说明
| 名称 | 参数类型 | 必填 | 描述 | 
|---|---|---|---|
| colorMode | ThemeColorMode | 否 | 内容模糊效果使用的深浅色模式。 默认值:ThemeColorMode.System  | 
| adaptiveColor | AdaptiveColor | 否 | 内容模糊效果使用的取色模式。 默认值:AdaptiveColor.Default  | 
| scale | number | 否 | 内容模糊效果程度。此参数为系统接口。 默认值:1.0 取值范围:[0.0, 1.0]  | 
示例
示例1
// 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%')
  }
}

你可能感兴趣的鸿蒙文章
harmony 鸿蒙@ohos.arkui.advanced.Counter(计数器组件)
harmony 鸿蒙@ohos.arkui.advanced.SegmentButton(分段按钮)
                        
                            0
                        
                        
                             赞
                        
                    
                    
                - 所属分类: 后端技术
 - 本文标签:
 
热门推荐
- 
                        2、 - 优质文章
 - 
                        3、 gate.io
 - 
                        7、 openharmony
 - 
                        9、 golang