HarmonyOS Badge右上角的位置可以调整吗?

@Builder
tabBuilder(title: Resource, targetIndex: number, selectedImg?: Resource, normalImg?: Resource) {
  Column({ space: 5 }) {
    Badge({
      count: 8,
      maxCount: 99,
      style: { badgeSize: 16, badgeColor: '#FA2A2D' },
      position: BadgePosition.RightTop,
    })
    {
      Image(this.currentIndex === targetIndex ? selectedImg : normalImg)
        .size(this.currentIndex === targetIndex ? { width: 25, height: 25 } : { width: 23, height: 23 })
    }

    Text(title)
      .fontColor(this.currentIndex === targetIndex ? '#ffb61e18' : '#6B6B6B')
      .fontSize(this.currentIndex === targetIndex ? 16 : 14)
  }
  .width('100%')
  .height(LayoutUtil.BottomTabsHeight)
  .border({})
  .justifyContent(FlexAlign.Center)
}

我设置了position: BadgePosition.RightTop, 但是UI上不太合适, 想往右再调整一下

阅读 528
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进