將子組件縱向布局

2024-01-22 17:48 更新

將子組件縱向布局,并在每個(gè)子組件之間插入一根橫向的分割線。

說明

該組件從API Version 7開始支持。后續(xù)版本如有新增內(nèi)容,則采用上角標(biāo)單獨(dú)標(biāo)記該內(nèi)容的起始版本。

子組件

可以包含子組件。

接口

ColumnSplit()

屬性

名稱

參數(shù)類型

描述

resizeable

boolean

分割線是否可拖拽,默認(rèn)為false。

說明

與RowSplit相同,ColumnSplit的分割線最小能拖動(dòng)到剛好包含子組件。

在真機(jī)中查看拖動(dòng)效果,預(yù)覽器中不支持拖動(dòng)。

不支持clip、margin通用屬性。

示例

  1. // xxx.ets
  2. @Entry
  3. @Component
  4. struct ColumnSplitExample {
  5. build() {
  6. Column(){
  7. Text('The secant line can be dragged').fontSize(9).fontColor(0xCCCCCC).width('90%')
  8. ColumnSplit() {
  9. Text('1').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
  10. Text('2').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
  11. Text('3').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
  12. Text('4').width('100%').height(50).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
  13. Text('5').width('100%').height(50).backgroundColor(0xF5DEB3).textAlign(TextAlign.Center)
  14. }
  15. .borderWidth(1)
  16. .resizeable(true) // 可拖動(dòng)
  17. .width('90%').height('60%')
  18. }.width('100%')
  19. }
  20. }

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)