• 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> RowSplit的分割线最小能拖动到刚好包含子组件。
26>
27> 在真机中查看拖动效果,预览器中不支持拖动。
28>
29> 不支持clip、margin通用属性。
30
31
32## 示例
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) // 可拖动
50      .width('90%').height(100)
51    }.width('100%').margin({ top: 5 })
52  }
53}
54```
55
56![zh-cn_image_0000001219982729](figures/zh-cn_image_0000001219982729.gif)
57