零基础学鸿蒙编程ArkTS/ArkUI实战1024

41、鸿蒙/布局/绝对定位

2024-08-01  本文已影响0人  圆梦人生

案例

@Component
export struct PositionLayout {
  build() {
    Column(){
      Text('1').width(50).height(50).backgroundColor(Color.Red)
      Text('2').width(50).height(50).backgroundColor(Color.Gray)
        .position({
          x: 80,
          y: 80
        }).zIndex(1)
      Text('3').width(50).height(50).backgroundColor(Color.Pink)
    }.width(200).height(200).backgroundColor(Color.Orange)
  }
}
position.png
上一篇 下一篇

猜你喜欢

热点阅读