可以在Stack组件中通过每个子组件的justifyContent属性,设置对齐方式参考demo:@Entry @Component struct linshi { build() { Stack() { Row() { Text('子组件1') }.justifyContent(FlexAlign.Center).width('100%').height('100%') Row() { Text('子组件2') }.justifyContent(FlexAlign.End).width('100%').height('100%') } } }
可以在Stack组件中通过每个子组件的justifyContent属性,设置对齐方式
参考demo: