ts-basic-components-blank.md 1.4 KB
Newer Older
Z
zengyawen 已提交
1
# Blank
Z
zengyawen 已提交
2

Z
zengyawen 已提交
3

4
> **NOTE**<br>
Z
zengyawen 已提交
5
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
Z
zengyawen 已提交
6

Z
zengyawen 已提交
7 8 9 10 11

The **&lt;Blank&gt;** component supports automatic filling of the empty part of the container along the main axis. This component is valid only when the parent component is **&lt;Row&gt;** or **&lt;Column&gt;**.


## Required Permissions
Z
zengyawen 已提交
12 13 14

None

Z
zengyawen 已提交
15 16

## Child Components
Z
zengyawen 已提交
17 18 19 20

None


Z
zengyawen 已提交
21 22 23 24 25
## APIs

Blank(min?:  Length)

- Parameters
E
esterzhou 已提交
26
    | Name | Type | Mandatory | Default Value | Description | 
Z
zengyawen 已提交
27
  | -------- | -------- | -------- | -------- | -------- |
E
esterzhou 已提交
28
  | min | Length | No | 0 | Minimum size of the **&lt;Blank&gt;** component in the container along the main axis. | 
Z
zengyawen 已提交
29 30 31 32


## Attributes

E
esterzhou 已提交
33
  | Name | Type | Default Value | Description | 
Z
zengyawen 已提交
34
| -------- | -------- | -------- | -------- |
E
esterzhou 已提交
35
| color | Color | 0x00000000 | Color to fill the blank. | 
Z
zengyawen 已提交
36

37
> **NOTE**<br>
38
> Universal attribute methods are not supported.
Z
zengyawen 已提交
39 40 41 42 43


## Example

  
Z
zengyawen 已提交
44 45 46 47 48 49 50 51 52
```
@Entry
@Component
struct BlankExample {
  build() {
    Column() {
      Row() {
        Text('Bluetooth').fontSize(18)
        Blank()
Z
zengyawen 已提交
53 54
        Toggle({ type: ToggleType.Switch })
      }.width('100%').backgroundColor(0xFFFFFF).borderRadius(15).padding({ left: 12 })
Z
zengyawen 已提交
55 56 57 58 59 60 61
    }.backgroundColor(0xEFEFEF).padding(20)
  }
}
```

Portrait mode

Z
zengyawen 已提交
62
![en-us_image_0000001256858407](figures/en-us_image_0000001256858407.gif)
Z
zengyawen 已提交
63 64 65

Landscape mode

Z
zengyawen 已提交
66
![en-us_image_0000001212378418](figures/en-us_image_0000001212378418.gif)