ColumnSplit
將子組件縱向布局,并在每個子組件之間插入一根橫向的分割線。
說明:
開發(fā)前請熟悉鴻蒙開發(fā)指導(dǎo)文檔 :[gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md
]
該組件從API Version 7開始支持。后續(xù)版本如有新增內(nèi)容,則采用上角標(biāo)單獨標(biāo)記該內(nèi)容的起始版本。
子組件
可以包含子組件。
接口
ColumnSplit()
屬性
名稱 | 參數(shù)類型 | 描述 |
---|---|---|
resizeable | boolean | 分割線是否可拖拽,默認(rèn)為false。 |
divider10+ | [ColumnSplitDividerStyle] | null |
ColumnSplitDividerStyle10+對象說明
名稱 | 參數(shù)類型 | 必填 | 描述 |
---|---|---|---|
startMargin | [Dimension] | 否 | 分割線與其上方子組件的距離。 默認(rèn)值:0 |
endMargin | [Dimension] | 否 | 分割線與其下方子組件的距離。 默認(rèn)值:0 |
說明:
與RowSplit相同,ColumnSplit的分割線可以改變上下兩邊子組件的高度,子組件可改變高度的范圍取決于子組件的最大最小高度。
HarmonyOS與OpenHarmony鴻蒙文檔籽料:mau123789是v直接拿
支持clip、margin等通用屬性,clip不設(shè)置的時候默認(rèn)值為true。
示例
// xxx.ets
@Entry
@Component
struct ColumnSplitExample {
build() {
Column(){
Text('The secant line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
ColumnSplit() {
Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
}
.borderWidth(1)
.resizeable(true) // 可拖動
.width('90%').height('60%')
}.width('100%')
}
}
審核編輯 黃宇
-
組件
+關(guān)注
關(guān)注
1文章
532瀏覽量
18420 -
鴻蒙
+關(guān)注
關(guān)注
60文章
2618瀏覽量
44041
發(fā)布評論請先 登錄
鴻蒙ArkTS容器組件:SideBarContainer

評論