开天辟地 HarmonyOS(鸿蒙) - 组件(布局类): RowSplit(水平分栏布局)

源码 https://github.com/webabcd/HarmonyDemo
作者 webabcd

开天辟地 HarmonyOS(鸿蒙) - 组件(布局类): RowSplit(水平分栏布局)

示例如下:

pages\component\layout\RowSplitDemo.ets

/*
 * RowSplit - 水平分栏布局(每个分栏的宽度可以通过手动拖动调整)
 */

import { TitleBar } from '../../TitleBar'

@Entry
@Component
struct RowSplitDemo {

  build() {
    Column({space:10}) {
      TitleBar()
      RowSplit() {
        Text('1').width('25%').height(100).backgroundColor(Color.Red).textAlign(TextAlign.Center)
        Text('2').width('25%').height(100).backgroundColor(Color.Green).textAlign(TextAlign.Center)
        Text('3').width('25%').height(100).backgroundColor(Color.Blue).textAlign(TextAlign.Center)
        Text('4').width('25%').height(100).backgroundColor(Color.Orange).textAlign(TextAlign.Center)
      }
      .resizeable(true)
    }
  }
}

源码 https://github.com/webabcd/HarmonyDemo
作者 webabcd

posted @ 2025-02-05 14:20  webabcd  阅读(79)  评论(0)    收藏  举报