国之双喜,快乐翻倍,用ArkTS书写祝福
完整源码
@Entry
@Component
struct Index {
@State message: string = "中秋月满乾坤,国庆星耀中华。\n" + "在这举杯邀明月、阖家庆团圆的佳节,\n" + " 鸿蒙坚果派恭祝您:\n" + " 家和人安,幸福美满;\n" + " 诸事如意,梦想可期。\n"
build() {
Column() {
Image($r("app.media.img_4")).width(60)
Row() {
Image($r("app.media.img_1")).width(75).size({ width: '30%', })
Image($r("app.media.img_2")).width(75).align(Alignment.Start)
.position({ x: 0, y: 0 })
Image($r("app.media.img_3")).width(75).position({ x: 2, y: 80 })
Image($r("app.media.img_5")).width(120)
}.margin({
bottom: 40
})
Text(this.message)
.fontSize(20)
.letterSpacing(3)
.fontColor(0xCC5500)
.fontWeight(500)
.textAlign(TextAlign.Center)
.lineHeight(28)
.margin({
left: 10, right: 10
})
Image($r("app.media.img_6")).width(136)
Image($r("app.media.img_7")).width(260)
}.width('100%')
.height('100%').backgroundColor("#ffe5e5")
}
}
效果图
