HarmonyOS textOverflow文字超出边界,显示省略号无效果?

代码如下:

@Entry
@Component
struct Test {
  build() {
    Stack() {
      Row(){
        Text('安徽省合肥市蜀山区金寨路189号(中国科大东区地铁站1号口步行470米)')
          .width('100%')
          .height(20)
          .textOverflow({overflow:TextOverflow.Ellipsis})
      }
      .width('100%')
      .padding(10)
    }
    .width('100%')
    .height('100%')
  }
}
阅读 520
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进