@Styles function style() {
.width(100)
.height(50)
.backgroundColor(Color.Pink)
.borderRadius(50)
}
@Entry
@Component
struct StyleCase {
build() {
Row() {
Column() {
Text('测试1')
.fontSize(20)
.fontColor(Color.Black)
.textAlign(TextAlign.Center)
.style()
Text('测试2')
.fontSize(20)
.fontColor(Color.Black)
.textAlign(TextAlign.Center)
.style()
.margin({
top: 20
})
}
.width('100%')
}
.height('100%')
}
}
网友评论