鸿蒙-->Row
·
@Preview
@Component
struct RowS{
build() {
Row() {
Text('one')
.width(60)
.height(60)
.backgroundColor('#4ECDC4') // 颜色
.textAlign(TextAlign.Center)
.fontColor(Color.White)
Text('two')
.width(60)
.height(60)
.backgroundColor('#45B7D1')
.textAlign(TextAlign.Center)
.fontColor(Color.White)
Text('three')
.width(60)
.height(60)
.backgroundColor('#FFD700')
.textAlign(TextAlign.Center)
.fontColor(Color.White)
Text('four')
.width(60)
.height(60)
.backgroundColor('#9B59B6')
.textAlign(TextAlign.Center)
.fontColor(Color.White)
}
.width('100%')
.justifyContent(FlexAlign.Start)
.backgroundColor('#ffffff') // 背景色,方便观察
}
}
.justifyContent(FlexAlign.Start)

.justifyContent(FlexAlign.Center)

.justifyContent(FlexAlign.End)

.justifyContent(FlexAlign.SpaceBetween)

.justifyContent(FlexAlign.SpaceAround)

.justifyContent(FlexAlign.SpaceEvenly)

更多推荐



所有评论(0)