Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用PullList第一次上拉能否实现类似scrollView的惯性滑动? #17

Open
yuruiyin opened this issue Jan 13, 2017 · 9 comments

Comments

@yuruiyin
Copy link

No description provided.

@yuruiyin yuruiyin changed the title 使用PullList上拉没有实现类似scrollVIEW 使用PullList第一次上拉能否实现类似scrollView的惯性滑动? Jan 13, 2017
@greatbsky
Copy link
Owner

不太了解你说的惯性滑动,IOS下的?最好能传个效果图

@yuruiyin
Copy link
Author

android下面的,就是scrollView 手指快速滑动的那种效果。 手指离开屏幕之后,有一个滑动速度, 列表还是会惯性滑动一小段。 您现有的PullList 第一次手指快速上拉滑动的时候没有惯性滑动这种效果。 您可以试试。

@NightFarmer
Copy link

确实有这个问题 我也发现了 首次上划时手指从哪里离开view就停在哪里 并不会根据离开时的滚动速度继续滑动下去 有没有什么方法能够解决呢

@greatbsky
Copy link
Owner

greatbsky commented Jan 13, 2017

哦~~了解了,有时间的时候考虑下怎么实现,谢谢反馈

@NightFarmer
Copy link

如果有了新的解决方案请务必回复我 感谢 😃

@kunkun12
Copy link

kunkun12 commented Jan 17, 2017

我也遇到了这个问题。Android上第一次上滑的时候 有些卡顿的样子

@greatbsky
Copy link
Owner

再想想办法~~~

@wangqianjun
Copy link

+1

@fantasy525
Copy link

No description provided.

请问你实现了吗?我看源码发现是这里导致的

    onShouldSetPanResponder(e, gesture) {
        if (!this.pullable || !isVerticalGesture(gesture.dx, gesture.dy)) { //不使用pullable,或非向上 或向下手势不响应
            return false;
        }
        // if (this.props.onPulling || this.props.onPullOk || this.props.onPullRelease) {
        //     return !this.state.scrollEnabled;
        // }
			console.log('scrollEnabled',this.state.scrollEnabled)
        if (!this.state.scrollEnabled) {
        	console.log('should pan')
            this.lastY = this.state.pullPan.y._value;
            return true;
        } else  {
					console.log('should not pan')
            return false;
        }
    }

第一次下拉时return true就导致scrollview不会相应了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants