如何让Swiper在一屏中显示两个Item?-鸿蒙开发者社区-51CTO.COM

如何让Swiper在一屏中显示两个Item?

如何让Swiper在一屏中显示两个Item?

HarmonyOS
2024-07-23 10:26:44
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
trobust
1

设置displayCount为2,可以在一屏中显示2个item。

Swiper() {
  Text("1").width("100%")
    .backgroundColor(Color.Yellow)
    .height(100)
  Text("2").width("100%")
    .backgroundColor(Color.Green)
    .height(100)
  Text("3").width("100%")
    .backgroundColor(Color.Gray)
    .height(100)
  Text("4").width("100%")
    .backgroundColor(Color.Pink)
    .height(100)
}
.height(100)
.displayCount(2)
分享
微博
QQ
微信
回复
2024-07-23 18:58:50
相关问题
HarmonyOS 怎么两个list同时滚动
412浏览 • 1回复 待解决
HarmonyOS 两个object怎么拼接成
732浏览 • 1回复 待解决
HarmonyOS 怎么把两个PixelMap合成
734浏览 • 2回复 待解决
HarmonyOS 如何合并两个对象
586浏览 • 1回复 待解决
HarmonyOS llibrary两个页面如何跳转
232浏览 • 1回复 待解决
ArkTS开发如何比较两个string是否致 ?
7146浏览 • 3回复 待解决
如何判断判断两个日期是否是同
911浏览 • 1回复 待解决