IOS scroll-view内嵌套swiper出现问题
发布于 5 年前 作者 bzhu 4902 次浏览 来自 问答
  • 当前 Bug 的表现(可附上截图)

    scroll-view(height: 100%)内嵌套swiper, view;

    swiper轮播时,swiper下方view不显示

  • 提供一个最简复现 Demo

<scroll-view

     scroll-y

     style=“height: 100%; position: absolute; top: 0; left: 0;”>

<view class=“banner”>

<swiper

wx:if=""

class=“home_swiper”

indicator-color="#606060"

indicator-active-color="#fff"

interval="{{interval}}"

indicator-dots=“true”

previous-margin=“40px”

next-margin=“40px”

circular=“true”

autoplay=“true”>

<repeat for="" key=“index” index=“index” item=“item”>

<swiper-item class=“home_swiper_item”>

<navigator url="" hover-class=“none”>

    …

</navigator>

</swiper-item>

</repeat>

</swiper>

</view>

<view class=“home_center”>

    …

</view>

<view class=“home_box” wx:if="{{themeData.length}}">

    …

</view>

</scroll-view>

8 回复

我最后把scroll-view换成了别的组件

嗯嗯,我们目前也是这样,但是我觉得用户体验不太好,有个banner轮播感觉档次会高点

你换的什么呢,我们的swiper是用在banner轮播,我还没去看用什么替换

我就换了view    我们轮播后来改成固定位置,不需要随页面滚动了

我找到解决方法的话告诉你吧

嘿嘿    目前我也是没找到其他办法啦

我也遇到同样的问题,我觉得应该是滑动冲突的问题,swiper获取了屏幕焦点,导致scroll-view失去焦点不能滑动

回到顶部