#鸿蒙学习大百科#如何让Swiper露出前面一部分和后面一部分以便于让用户理解此控件可以滑动?

如何让Swiper露出前面一部分和后面一部分以便于让用户理解此控件可以滑动?

HarmonyOS
2024-09-25 10:35:24
816浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
蓝黑沫夏
@Entry
@Component
struct Index {
  build() {
    Column() {
      Swiper() {
        Text().width("100%")
          .height(200)
          .backgroundColor(Color.Blue)
          .margin(5)
        Text().width("100%")
          .height(200)
          .backgroundColor(Color.Yellow)
          .margin(5)
        Text().width("100%")
          .height(200)
          .backgroundColor(Color.Pink)
          .margin(5)
      }
      .prevMargin(30)//露出前面的尺寸
      .nextMargin(30)//露出后面的尺寸

    }
    .height('100%')
    .width('100%')
  }
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.

分享
微博
QQ
微信
回复
2024-09-25 15:35:29
相关问题
自选swiper能否在屏幕中显示一部分
1248浏览 • 1回复 待解决