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

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

HarmonyOS
2024-09-25 10:35:24
浏览
收藏 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%')
  }
}

分享
微博
QQ
微信
回复
2024-09-25 15:35:29
相关问题