• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RowSplit
2
3将子组件横向布局,并在每个子组件之间插入一根纵向的分割线。
4
5>  **说明:**
6>
7> 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
8
9## 子组件
10
11可以包含子组件
12
13## 接口
14
15RowSplit()
16
17
18## 属性
19
20| 名称 | 参数类型 | 描述 |
21| -------- | -------- | -------- |
22| resizeable | boolean | 分割线是否可拖拽,默认为false。 |
23
24>  **说明:**
25>
26> RowSplit的分割线可以改变左右两边子组件的宽度,子组件可改变宽度的范围取决于子组件的最大最小宽度。
27>
28> 支持clip、margin等通用属性,clip不设置的时候默认值为true。
29
30
31## 示例
32
33```ts
34// xxx.ets
35@Entry
36@Component
37struct RowSplitExample {
38  build() {
39    Column() {
40      Text('The second line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
41      RowSplit() {
42        Text('1').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
43        Text('2').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
44        Text('3').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
45        Text('4').width('10%').height(100).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
46        Text('5').width('10%').height(100).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
47      }
48      .resizeable(true) // 可拖动
49      .width('90%').height(100)
50    }.width('100%').margin({ top: 5 })
51  }
52}
53```
54
55![zh-cn_image_0000001219982729](figures/zh-cn_image_0000001219982729.gif)
56