可以尝试使用如下代码:@Entry @Component struct relative { build() { Column() { Row() { Image('') .height(100) .width(100) .backgroundColor(0xDCDCDC) Column() { Row() { Text('title123123123123123123123123312') .fontSize(14) .textOverflow({ overflow: TextOverflow.Ellipsis }) .maxLines(1) .layoutWeight(1) .margin({ left: 10 }) .id('title') Text('time123213') .fontSize(12) .id('time') Image('') .height(20) .width(20) .id('image') .backgroundColor(0xDCDCDC) } }.layoutWeight(1) .height(100) .justifyContent(FlexAlign.Start) } }.width("100%").height("100%") } }这里的截断机制是把后面所有的数字识别为是一个字符,所以全部截断了,可以设置属性.wordBreak(WordBreak.BREAK\_ALL)来解决该问题参考链接MeasureOptions
可以尝试使用如下代码:
这里的截断机制是把后面所有的数字识别为是一个字符,所以全部截断了,可以设置属性.wordBreak(WordBreak.BREAK\_ALL)来解决该问题
参考链接
MeasureOptions