HarmonyOS 文字在Row中不居中

很简单的案例:

Row() {
  Text("测试文字")
}.backgroundColor('#be14807f')

这个时候可以看见文字并没有居中偏顶部。

HarmonyOS
2024-12-24 17:38:29
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
Excelsior_abit

参考demo:

Row() {
  Text("测试文字")
}
.backgroundColor('#be14807f')
.height(100)
.width(100)
.align(Alignment.Center)
.justifyContent(FlexAlign.Center)

参考文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-container-row-V5

分享
微博
QQ
微信
回复
2024-12-24 19:51:33
相关问题
HarmonyOS 文字行高设定后文字居中
1289浏览 • 1回复 待解决
HarmonyOS Row组件怎么居中
887浏览 • 1回复 待解决
HarmonyOS TextRow设置Align属性生效
1241浏览 • 1回复 待解决
画布绘制文字,垂直居中
1193浏览 • 1回复 待解决
HarmonyOS 弹窗文字居中
563浏览 • 1回复 待解决
HarmonyOS 文字标题没有垂直居中对齐
901浏览 • 1回复 待解决
HarmonyOS Text设置align居中
1389浏览 • 1回复 待解决
HarmonyOS RichEditor 内容居中显示
856浏览 • 1回复 待解决
HarmonyOS使用canvas如何使文字垂直居中
1648浏览 • 1回复 待解决
HarmonyOS bindsheet弹出居中弹框
953浏览 • 1回复 待解决
HarmonyOS row的子控件超出了row的范围
1566浏览 • 1回复 待解决
嵌套组件Scroll生效
3075浏览 • 1回复 待解决
HarmonyOS Navigationtitle怎么居中显示
1108浏览 • 1回复 待解决