ts-universal-attributes-backgroundBlurStyle.md 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# Background Blur

You can apply background blur effects to a component.

>  **NOTE**
> 
>The APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.

## Required Permissions

None

## Attributes

| Name        | Type     | Default Value                 | Description                    |
| ------------ | ------------- | ----------------------- | ------------------------ |
| backgroundBlurStyle       | [BlurStyle](#blurstyle) | - | Style of the blur between the background and content for the current component. The input parameter indicates a blur material.|

## BlurStyle

| Name  | Description                                           |
| ------ | ----------------------------------------------- |
| Thin | Thin material.|
| Regular | Regular material.                     |
| Thick  | Thick material.                               |



## Example

```ts
// xxx.ets
@Entry
@Component

struct Index {
  build() {
    Column() {
      Row() {
        Text("Thin Material")
      }
      .width(350)
      .height(300)
      .backgroundBlurStyle(BlurStyle.Thin)
      .position({x: "15%", y: "30%"})
    }
    .height('100%')
    .width('100%')
    .backgroundImage($r('app.media.bg'))
    .backgroundImageSize(ImageSize.Cover)
  }
```
![en-us_image_background_blur_style](figures/en-us_image_background_blur_style.png)