可以给组件设置以下属性可以解决显示的间隙问题:.pixelRound({ top:PixelRoundCalcPolicy.FORCE\_FLOOR, end:PixelRoundCalcPolicy.FORCE\_CEIL })文档: https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-layout-constraints-0000001815927508\#ZH-CN\_TOPIC\_0000001815927508\_\_pixelround11参考代码:Row() { Text('返回') .textAlign(TextAlign.Center) .height('100%') .aspectRatio(1) .fontColor('#FFCB88') .fontSize(11) .backgroundColor('#112e53') Image($r('app.media.img_fan')) .aspectRatio(0.72) .height('100%') .objectFit(ImageFit.Cover) .pixelRound({ top:PixelRoundCalcPolicy.FORCE_FLOOR, end:PixelRoundCalcPolicy.FORCE_CEIL }) Text('¥' + 8.12) .height('100%') .padding({left:3, right:3}) .fontColor(Color.White) .fontSize(11) .backgroundColor('#8156f2') .textAlign(TextAlign.Center) .pixelRound({ top:PixelRoundCalcPolicy.FORCE_FLOOR, end:PixelRoundCalcPolicy.FORCE_CEIL }) }.margin({right:10})
可以给组件设置以下属性可以解决显示的间隙问题:.pixelRound({ top:PixelRoundCalcPolicy.FORCE\_FLOOR, end:PixelRoundCalcPolicy.FORCE\_CEIL })
文档: https://developer.huawei.com/consumer/cn/doc/harmonyos-references/ts-universal-attributes-layout-constraints-0000001815927508\#ZH-CN\_TOPIC\_0000001815927508\_\_pixelround11
参考代码: