📚往期学习笔录📝:
📝 鸿蒙应用开发与鸿蒙系统开发哪个更有前景?
📝 嵌入式开发适不适合做鸿蒙南向开发?看完这篇你就了解了~
📝 对于大前端开发来说,转鸿蒙开发究竟是福还是祸?
📝 鸿蒙岗位需求突增!移动端、PC端、IoT到底该怎么选?
📝 记录一场鸿蒙开发岗位面试经历~
📝 持续更新中……
介绍
本示例介绍通过分割swiper区域,实现指示器导航点位于swiper下方的效果。
效果预览图

使用说明
- 加载完成后swiper指示器导航点,位于显示内容下方。
实现思路
- 将swiper区域分割为两块区域,上方为内容区域,下方为空白区域。
Column() {
Image(item)
.width($r('app.string.one_hundred_percent'))
.height($r('app.string.thirty_percent'))
.borderRadius($r('app.integer.borderRadius_value'))
Column()
.width($r('app.string.one_hundred_percent'))
.height($r('app.integer.blank_space_height'))
}
- 通过indicator属性调整指示器导航点位置,使其位于空白区域。
Swiper(this.swiperController) {
...
}
.width($r('app.string.ninety_five_percent'))
.loop(true)
.autoPlay(true)
.indicator(new DotIndicator().bottom($r('app.integer.offset_value')))
高性能知识点
不涉及
工程结构&模块类型
indicatorbelowswiper // har类型
|---view
| |---IndicatorBelowSwiper.ets // 视图层-swiper指示器导航点位于swiper下方

1380

被折叠的 条评论
为什么被折叠?



