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

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

Z
zengyawen 已提交
6

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


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

None

Z
zengyawen 已提交
14 15

## Child Components
Z
zengyawen 已提交
16

E
ester.zhou 已提交
17
Supported
Z
zengyawen 已提交
18 19


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

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


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

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

E
ester.zhou 已提交
31 32
>  **NOTE**
> Similar to **\<RowSplit>**, the divider of **\<RowSplit>** can be dragged to a position that just fully holds a component.
Z
zengyawen 已提交
33 34 35 36


## Example

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