HarmonyOS Swiper组件的Indicator设置bottom(0)没有贴底
private swiperController: SwiperController = new SwiperController() 
 
@Builder 
content() { 
 Column() { 
  Swiper(this.swiperController) { 
   Stack() { 
    Text("1") 
     .width('100%') 
     .height(155) 
     .backgroundColor('#a067c8ff') 
     .textAlign(TextAlign.Center) 
     .fontSize(30) 
   } 
   .alignContent(Alignment.TopStart) 
   .margin({ left: 4, right: 4 }) 
   .height(172) 
 
   Stack() { 
    Text("2") 
     .width('100%') 
     .height(155) 
     .backgroundColor('#4067c8ff') 
     .textAlign(TextAlign.Center) 
     .fontSize(30) 
   }.alignContent(Alignment.TopStart) 
   .margin({ left: 4, right: 4 }) 
   .height(172) 
 
 
   Stack() { 
    Text("3") 
     .width('100%') 
     .height(172) 
     .backgroundColor('#7067c8ff') 
     .textAlign(TextAlign.Center) 
     .fontSize(30) 
   }.alignContent(Alignment.TopStart) 
   .margin({ left: 4, right: 4 }) 
   .height(172) 
 
  } 
  .loop(true) 
  .autoPlay(true) 
  .interval(5000) 
  .nextMargin(12) 
  .prevMargin(12) 
  .height(172) 
  .indicator( 
   Indicator.dot() 
    .bottom(0) 
    .itemWidth(10) 
    .itemHeight(2) 
    .selectedItemWidth(16) 
    .selectedItemHeight(2) 
    .color('#1E666666') 
    .selectedColor('#666666') 
  ) 
 } 
 .width('100%').height(172).alignSelf(ItemAlign.Start) 
}如上代码,设置了Indicator.dot().bottom(0)想让指示器贴底,但是发现还有一段距离,不能实现紧贴底部。
        HarmonyOS
      
        赞
        
 收藏 0
 回答 1
 
        待解决
        
相关问题
 HarmonyOS  Swiper组件的Indicator能支持间距设置吗 
1255浏览  • 1回复 待解决
组件实现未占满时自定义footer贴底显示 
1498浏览  • 1回复 待解决
HarmonyOS Swiper容器中的indicator可以设置偏移么 
1093浏览  • 1回复 待解决
HarmonyOS Swiper使用时Indicator设置位置不生效 
1821浏览  • 1回复 待解决
HarmonyOS  Swiper组件的indicator有个默认宽高,且没有办法修改 
1036浏览  • 1回复 待解决
HarmonyOS Swiper设置displayCount显示多个indicator个数还是所有item个数? 
1493浏览  • 1回复 待解决
HarmonyOS NFC贴卡没有反应 
1987浏览  • 1回复 待解决
Swiper的indicator后续会支持自定义吗 
3197浏览  • 1回复 待解决
Swiper的indicator 在使用过程整,IDE提示错误 
1787浏览  • 1回复 待解决
HarmonyOS Swiper同时设置indicator指示器样式和指示器是否展示冲突问题 
1302浏览  • 1回复 待解决
HarmonyOS Tabs组件设置默认的tabcontent不是0 
1001浏览  • 1回复 待解决
HarmonyOS swiper子组件,会被强行宽高设置占满整个Swiper的大小 
1440浏览  • 1回复 待解决
HarmonyOS 如何设置swiper组件中DotIndicator指示器的位置在swiper的外部 
1399浏览  • 1回复 待解决
HarmonyOS Swiper组件的分页图标没法设置到底部 
1311浏览  • 1回复 待解决
Swiper组件如何设置导航点位置 
4321浏览  • 1回复 待解决
HarmonyOS RN Bottom-tabs组件返回问题 
1009浏览  • 1回复 待解决
HarmonyOS Swiper组件两边子组件不能设置高度 
1232浏览  • 1回复 待解决
HarmonyOS 父组件设置高度为0对Image组件不生效 
1332浏览  • 1回复 待解决
Swiper组件设置不跟随手势滑动 
1725浏览  • 1回复 待解决
HarmonyOS Swiper组件怎么设置滑动时缩放的交互动画 
1416浏览  • 1回复 待解决
HarmonyOS 使用swiper组件通过cachedCount设置预加载组件个数无效 
1234浏览  • 1回复 待解决
父组件高度为0时,如何设置溢出隐藏 
2237浏览  • 1回复 待解决
#鸿蒙通关秘籍#如何设置Swiper组件的垂直方向轮播? 
1461浏览  • 1回复 待解决
HarmonyOS Swiper组件支持滑动监听以及设置具体滚动位置 
1585浏览  • 1回复 待解决
HarmonyOS swiper组件的使用问题 
1427浏览  • 1回复 待解决





















Indicator 导航点的可见范围边界至实际范围边界存在一定距离,该距离会随着itemWidth、itemHeight、selectedItemWidth、selectedItemHeight等参数变大而变大,因此无法完全靠左。参考地址:
https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-container-swiper-V5
目前Indicator与swiper组件的边界有一定距离,bottom(0)不是贴在边界处的效果,以下是尝试解决方法:
1、将swiper分开,上方是内容区,下方是Indicator区域,可设置内容区的宽高调整Indicator区域的大小 ,您可以参考此demo:
https://gitee.com/harmonyos-cases/cases/blob/master/CommonAppDevelopment/feature/indicatorbelowswiper/README.md#/harmonyos-cases/cases/blob/master/CommonAppDevelopment/feature/indicatorbelowswiper/src/main/ets/view/IndicatorBelowSwiper.ets
2、通过自定义指示器,以下是demo: