HarmonyOS 如何实现给文字都加上粗线条?

返回文字长度不固定,如何实现给数字部分的文字都加上线条?

阅读 593
1 个回答

请参考demo:

@Entry
@Component
struct Index {
  @State message: string = 'Hello BETA1';
  build() {
    RelativeContainer() {
      Column(){
        Text('9.811111111111')
          .fontSize(20)
          .shadow({ radius: 5,color: Color.Pink, offsetX: 0, offsetY: 45 ,fill:true })
      }.height(4)
    }
    .height('100%')
    .width('100%')
  }
}