• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RowSplit
2
3The **\<RowSplit>** lays out child components horizontally and inserts a vertical divider between every two child components.
4
5>  **NOTE**
6>
7> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
8
9## Child Components
10
11Supported
12
13This component limits the width of its child components. During initialization, the layout of the component is calculated based on the width of its child components. After initialization, changes to the width of the child components do not take effect. Still, the space occupied by the child components can be changed by dragging the dividers between them.
14## APIs
15
16RowSplit()
17
18
19## Attributes
20
21| Name| Type| Description|
22| -------- | -------- | -------- |
23| resizeable | boolean | Whether the divider can be dragged.<br/>Default value: **false** |
24
25>  **NOTE**
26>
27> The divider of **\<RowSplit>** can change the width of the left and right child components, but only to the extent that the resultant width falls within the maximum and minimum widths of the child components.
28>
29> Universal attributes such as [clip](ts-universal-attributes-sharp-clipping.md) and [margin](ts-universal-attributes-size.md) are supported. If **clip** is not set, the default value **true** is used.
30
31
32## Example
33
34```ts
35// xxx.ets
36@Entry
37@Component
38struct RowSplitExample {
39  build() {
40    Column() {
41      Text('The second line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
42      RowSplit() {
43        Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
44        Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
45        Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
46        Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
47        Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
48      }
49      .resizeable(true) // The divider can be dragged.
50      .width('90%').height(100)
51    }.width('100%').margin({ top: 5 })
52  }
53}
54```
55
56![en-us_image_0000001219982729](figures/en-us_image_0000001219982729.gif)
57