ts-container-rowsplit.md 1.5 KB
Newer Older
Z
zengyawen 已提交
1
# RowSplit
Z
zengyawen 已提交
2

E
ester.zhou 已提交
3
The **\<RowSplit>** lays out child components horizontally and inserts a vertical divider between every two child components.
Z
zengyawen 已提交
4

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

Z
zengyawen 已提交
9 10

## Child Components
Z
zengyawen 已提交
11

E
ester.zhou 已提交
12
Supported
Z
zengyawen 已提交
13 14


Z
zengyawen 已提交
15
## APIs
Z
zengyawen 已提交
16

Z
zengyawen 已提交
17
RowSplit()
Z
zengyawen 已提交
18 19


Z
zengyawen 已提交
20
## Attributes
Z
zengyawen 已提交
21

E
ester.zhou 已提交
22
| Name| Type| Description|
Z
zengyawen 已提交
23
| -------- | -------- | -------- |
E
ester.zhou 已提交
24
| resizeable | boolean | Whether the divider can be dragged. The default value is **false**.|
Z
zengyawen 已提交
25

E
ester.zhou 已提交
26
>  **NOTE**
E
ester.zhou 已提交
27 28
>
>  Similar to **\<RowSplit>**, the divider of **\<RowSplit>** can be dragged to a position that just fully holds a component.
Z
zengyawen 已提交
29 30 31 32


## Example

E
ester.zhou 已提交
33 34
```ts
// xxx.ets
Z
zengyawen 已提交
35 36 37 38 39
@Entry
@Component
struct RowSplitExample {
  build() {
    Column() {
E
ester.zhou 已提交
40
      Text('The second line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
Z
zengyawen 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54
      RowSplit() {
        Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
        Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
        Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
        Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
        Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
      }
      .resizeable(true) // The divider can be dragged.
      .width('90%').height(100)
    }.width('100%').margin({ top: 5 })
  }
}
```

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