scroll - 垂直滚动不适用于 ionic 中的水平滚动列表

标签 scroll ionic-framework

我有一个垂直滚动的窗口,在这个滚动中我有几个水平滚动的图像列表。

<ion-content class="container">
    <ion-scroll direction="y" class="wide-as-needed">
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>
        <div>
            <ion-scroll direction="x" class="wide-as-needed">
                <imgcard ng-repeat="item in items" card="item"></imgcard>
            </ion-scroll>
        </div>

</ion-content>

在这里<imgcard>指令归结为:

<div class="card">
    <div class="card-image">
        <img src="{{card.image}}"/>
    </div>
    <div class="card-description">
        {{card.desc}}
    </div>
</div>

现在的问题是,在移动设备上,如果我触摸图像列表之间的空间,我会尝试垂直滚动,但效果很好。但是,如果我在垂直滚动时触摸图像列表,它就不起作用。

最佳答案

我认为这是一个 ionic 错误。 在 ionic bundle 的第 8392 行设置了变量 isScrolling

if ( typeof isScrolling == 'undefined') {
isScrolling = !!( isScrolling || Math.abs(delta.x) < Math.abs(delta.y) );
}

但是当我调试我的应用程序时,delta.x==0 和 delta.y==0 大多数时候也是 isScrolling==false。 只需在比较中添加一个 =。

关于scroll - 垂直滚动不适用于 ionic 中的水平滚动列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32749774/

相关文章:

android - ionic cordova-plugin-camerapreview "no preview"

angular - Ionic2/Angular2 - 读取自定义配置文件

javascript - Typescript Konva 类变量不在范围内

javascript - Meteor + React 中的错误消息 "state is not defined"。

ionic-framework - 如何在 ionic 图标中填充颜色 ios-thumbs-up-outline

javascript - 如何在不实际滚动的情况下确定滚动方向

javascript - 如何确定用户是否使用 jQuery 滚动到 HTML 容器的末尾?

database - 使用 TypeORM Cordova 数据库将图像保存为 Blob

JQuery Tools Scrollable : On Click, 停止滚动?

delphi - Delphi 同步滚动组件