增加标题中间文字备注

这个提交包含在:
胡玲 2025-03-17 18:43:00 +08:00
父节点 ecfef2154b
当前提交 e2324ecbdc

查看文件

@ -44,6 +44,8 @@ export struct SafeView {
// 设置返回按钮事件 // 设置返回按钮事件
@Prop onClickLeft: TitleBarBtn @Prop onClickLeft: TitleBarBtn
@Prop onClickRight: TitleBarBtn @Prop onClickRight: TitleBarBtn
// 设置导航栏底下标题
@Prop bottomTitleText: ResourceStr
@Builder @Builder
doNothingBuilder() { doNothingBuilder() {
@ -90,18 +92,24 @@ export struct SafeView {
} }
}) })
Text(this.titleText ?? '') Column() {
.maxLines(1) Text(this.titleText ?? '')
.fontColor(this.titleColor ?? '#11102C') .maxLines(1)
.fontSize(16) .fontColor(this.titleColor ?? '#11102C')
.fontWeight(FontWeight.Medium) .fontSize(16)
.ellipsisMode(EllipsisMode.CENTER) .fontWeight(FontWeight.Medium)
.textOverflow({ .ellipsisMode(EllipsisMode.CENTER)
overflow: TextOverflow.Ellipsis .textOverflow({
}) overflow: TextOverflow.Ellipsis
.constraintSize({ })
maxWidth: 200 .constraintSize({
}) maxWidth: 200
})
if (this.bottomTitleText) {
Text(this.bottomTitleText ?? '').fontColor('#CB8204').fontSize(12).margin({ top: 4 })
}
}
Row() { Row() {
if (!this.onClickLeft?.img && this.onClickLeft) { if (!this.onClickLeft?.img && this.onClickLeft) {
@ -110,7 +118,7 @@ export struct SafeView {
style: { style: {
badgeSize: 6, badgeSize: 6,
badgeColor: Color.Red, badgeColor: Color.Red,
fontSize:1, fontSize: 1,
color: '#FF6500', color: '#FF6500',
} }
}) { }) {
@ -128,7 +136,7 @@ export struct SafeView {
badgeSize: 6, badgeSize: 6,
badgeColor: '#FF6500', badgeColor: '#FF6500',
color: '#FF6500', color: '#FF6500',
fontSize:1 fontSize: 1
} }
}) { }) {
Image(this.onClickLeft.img) Image(this.onClickLeft.img)
@ -147,7 +155,7 @@ export struct SafeView {
badgeSize: 6, badgeSize: 6,
badgeColor: '#FF6500', badgeColor: '#FF6500',
color: '#FF6500', color: '#FF6500',
fontSize:1 fontSize: 1
} }
}) { }) {
Text(this.onClickRight?.text ?? '确定') Text(this.onClickRight?.text ?? '确定')
@ -167,7 +175,7 @@ export struct SafeView {
badgeSize: 6, badgeSize: 6,
badgeColor: '#FF6500', badgeColor: '#FF6500',
color: '#FF6500', color: '#FF6500',
fontSize:1 fontSize: 1
} }
}) { }) {
Image(this.onClickRight.img) Image(this.onClickRight.img)