HarmonyOS Swiper同时设置indicator指示器样式和指示器是否展示冲突问题?

咨询描述:Swiper 同时设置代码:用来控制指示器是否展示,以及指示器样式,发现后面设置的样式会覆盖,是否展示的逻辑,如何设置才能达到

阅读 496
1 个回答

参考以下方式实现:

.indicator( // 设置圆点导航点样式
  this.data.totalCount()>1?
  new DotIndicator()
    .itemWidth(15)
    .itemHeight(15)
    .selectedItemWidth(15)
    .selectedItemHeight(15)
    .color(Color.Gray)
    .selectedColor(Color.Blue)
    : false
)
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进