![](https://s5-media.51cto.com/ost/pc/static/noavatar.gif)
回复
笔者一直以来以OpenHarmony南向开发为主,随着北向开发api越来越丰富且越来越趋于稳定,笔者决定恢复一度中断的北向开发之旅…
@toc
1.空白填充组件,在容器主轴方向上,空白填充组件具有自动填充容器空余部分的能力。
2.仅当父组件为Row/Column时生效。
3.官方文档仓库 Blank空白填充组件
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Blank()
Row() {
Blank()
Text('abc').fontSize(50)
Blank()
Text("123").fontSize(50)
Blank()
}.width('100%')
Blank()
}
.width('100%')
.height('100%')
}
.width('100%')
.height('100%')
}
}
@Entry
@Component
struct Index {
build() {
Row() {
Column() {
Blank()
Text('abc').fontSize(50)
Blank()
Text("123").fontSize(50)
Blank()
}
.height('100%')
}
.width('100%')
.height('100%')
}
}
在设置中开发者选项开启显示边界布局,可以方便调试组件布局
OpenHarmony 终端截屏命令
snapshot_display