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

Z
zengyawen 已提交
3

Z
zengyawen 已提交
4 5
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE:**
> 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 **<RowSplit>** lays out child components horizontally and inserts a vertical divider between every two child components.


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

None

Z
zengyawen 已提交
15 16

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

This component can contain child components.


Z
zengyawen 已提交
21
## APIs
Z
zengyawen 已提交
22

Z
zengyawen 已提交
23
RowSplit()
Z
zengyawen 已提交
24 25


Z
zengyawen 已提交
26
## Attributes
Z
zengyawen 已提交
27

Z
zengyawen 已提交
28 29 30
  | Name | Type | Description | 
| -------- | -------- | -------- |
| resizeable | boolean | Whether the divider can be dragged. The default value is **false**. | 
Z
zengyawen 已提交
31

Z
zengyawen 已提交
32 33 34 35 36 37 38
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE:**
> Similar to **<RowSplit>**, the divider of **<RowSplit>** can be dragged to a position that just fully holds a component.


## Example

  
Z
zengyawen 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
```
@Entry
@Component
struct RowSplitExample {
  build() {
    Column() {
      Text('The secant line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
      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 已提交
60
![en-us_image_0000001212058482](figures/en-us_image_0000001212058482.gif)