使用lineHeight行间距展示不正确

Text展示多行文字是,设置lineHeight后,不想使用第一行上的间距。

HarmonyOS
2024-10-11 12:02:48
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

可以在添加padding属性来调节第一行上的间距。

示例:

Text('This is the text with the line height set. This is the text with the line height set.')  
  .fontSize(12)  
  .border({ width: 1 })  
  .lineHeight(20)  
  .padding({top: -10})
已于2024-10-11 16:51:24修改
分享
微博
QQ
微信
回复
2024-10-11 16:51:18
相关问题
Text多行展示时,如何设置行间距
1154浏览 • 1回复 待解决
Span组件设置行间距间距
1570浏览 • 1回复 待解决
HarmonyOS text如何设置行间距
751浏览 • 1回复 待解决
HarmonyOS Text组件设置行间距吗?
1475浏览 • 1回复 待解决
HarmonyOS 如何设置Text的行间距
826浏览 • 1回复 待解决
web页面栈不正确,如何处理?
1266浏览 • 1回复 待解决