HarmonyOS NEXT应用开发之swiper指示器导航点位于swiper下方

介绍

本示例介绍通过分割swiper区域,实现指示器导航点位于swiper下方的效果。

效果预览图

使用说明

  1. 加载完成后swiper指示器导航点,位于显示内容下方。

实现思路

  1. 将swiper区域分割为两块区域,上方为内容区域,下方为空白区域。 源码参考IndicatorBelowSwiper.ets

    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'))
    }

  2. 通过indicator属性调整指示器导航点位置,使其位于空白区域。 源码参考IndicatorBelowSwiper.ets

    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下方

模块依赖

utils

参考资料

Swiper组件

为了能让大家更好的学习鸿蒙(HarmonyOS NEXT)开发技术,这边特意整理了《鸿蒙开发学习手册》(共计890页),希望对大家有所帮助:https://qr21.cn/FV7h05

《鸿蒙开发学习手册》:

如何快速入门:https://qr21.cn/FV7h05

  1. 基本概念
  2. 构建第一个ArkTS应用
  3. ......

开发基础知识:https://qr21.cn/FV7h05

  1. 应用基础知识
  2. 配置文件
  3. 应用数据管理
  4. 应用安全管理
  5. 应用隐私保护
  6. 三方应用调用管控机制
  7. 资源分类与访问
  8. 学习ArkTS语言
  9. ......

基于ArkTS 开发:https://qr21.cn/FV7h05

  1. Ability开发
  2. UI开发
  3. 公共事件与通知
  4. 窗口管理
  5. 媒体
  6. 安全
  7. 网络与链接
  8. 电话服务
  9. 数据管理
  10. 后台任务(Background Task)管理
  11. 设备管理
  12. 设备使用信息统计
  13. DFX
  14. 国际化开发
  15. 折叠屏系列
  16. ......

鸿蒙开发面试真题(含参考答案):https://qr18.cn/F781PH

鸿蒙开发面试大盘集篇(共计319页):https://qr18.cn/F781PH

1.项目开发必备面试题

2.性能优化方向

3.架构方向

4.鸿蒙开发系统底层方向

5.鸿蒙音视频开发方向

6.鸿蒙车载开发方向

7.鸿蒙南向开发方向

腾讯T10级高工技术,安卓全套VIP课程全网免费送:https://qr21.cn/D2k9D5

相关推荐
StarPrayers.8 分钟前
用 PyTorch 搭建 CIFAR10 线性分类器:从数据加载到模型推理全流程解析
人工智能·pytorch·python
IT小哥哥呀1 小时前
工业互联与设备IOT助力生产制造实践分享
物联网·交互·制造·简单工厂模式
Sherry Wangs2 小时前
显卡算力过高导致PyTorch不兼容的救赎指南
人工智能·pytorch·显卡
冻咸鱼2 小时前
MySQL中表操作
android·sql·mysql·oracle
Bert丶seven2 小时前
鸿蒙Harmony实战开发教学(No.6)-Search组件基础到进阶篇
华为·harmonyos·arkts·鸿蒙·鸿蒙系统·arkui·开发教学
技术小黑屋_2 小时前
从零搭建 Android ADB MCP Server:让 AI 助手直接操控你的 Android 设备
android·adb
万少2 小时前
HarmonyOS6 应用升级经验分享
harmonyos
蓝冰印2 小时前
HarmonyOS Next 快速参考手册
linux·ubuntu·harmonyos
流影ng2 小时前
【HarmonyOS】并发线程间的通信
typescript·harmonyos
2501_915921432 小时前
iOS混淆与IPA加固实战手记,如何构建苹果应用防反编译体系
android·macos·ios·小程序·uni-app·cocoa·iphone