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