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

嵌套在scrollview中 滑动的bug #336

Open
MirkoWu opened this issue Jul 26, 2017 · 13 comments
Open

嵌套在scrollview中 滑动的bug #336

MirkoWu opened this issue Jul 26, 2017 · 13 comments

Comments

@MirkoWu
Copy link

MirkoWu commented Jul 26, 2017

当嵌套在scrollview中时,滚轮无法正常滑动,我遇到的情况是 上滑下滑都会沿一个方向滚

@totcw
Copy link
Member

totcw commented Jul 26, 2017

什么意思?你是将滚轮单独放在Scrollview滑动异常?

@MirkoWu
Copy link
Author

MirkoWu commented Jul 26, 2017

是的,单独放在scrollView 中 ,手势处理这里有问题

@totcw
Copy link
Member

totcw commented Jul 26, 2017

如果将wheelview单独放在srcollview中是会出现滑动问题的,wheelview中并没有对嵌套滑动做处理.

@MirkoWu
Copy link
Author

MirkoWu commented Jul 26, 2017

那你考不考虑做这方面的处理呢

@MirkoWu
Copy link
Author

MirkoWu commented Jul 26, 2017

不处理的话 我只有当成一个library依赖来改了,要是你发布新版本的话,我就不提取了

@xiaosong520
Copy link
Member

@MirkoWu 这一两个月会考虑抽空优化一些功能,下个版本应该会处理一下滑动冲突的问题。如果你时间赶的话也可以自行在WheelView的onTouch里面做一下处理~代码量倒是不多。

@MirkoWu
Copy link
Author

MirkoWu commented Aug 1, 2017

嗯嗯,谢谢,也希望这个框架越来越完善。

@fsmytsai
Copy link

請問滑動衝突有解決了嗎?
小弟現在放在 ScrollView 中還是會滑動衝突

@aa86799
Copy link

aa86799 commented May 14, 2019

/**
 * desc   : 解决外层为 scrollView产生的滑动冲突
 * author : stone
 * email  : [email protected]
 * time   : 2019/5/14  16:34
 */
public class SWheelView extends WheelView {

    public SWheelView(Context context) {
        this(context, null);
    }

    public SWheelView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_MOVE:
            case MotionEvent.ACTION_UP:
                //让父布局禁用拦截事件功能
                if (getParent() != null) {
                    getParent().requestDisallowInterceptTouchEvent(true);
                }
               return super.onTouchEvent(event);
        }
        return false;
    }
}

@Neoqee
Copy link

Neoqee commented May 30, 2019

那如果我需要使用pickView呢?封装好的View没办法重写onTonch方法。 @aa86799 难道要下载下来自己去重新改源码吗?

@sinduanan
Copy link

@aa86799 老哥,为你的行为点赞!

@xuexirong
Copy link

@aa86799 牛逼 大佬

@pizhu
Copy link

pizhu commented Dec 4, 2020

@aa86799 一看老哥就做实事的

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

No branches or pull requests

9 participants