简体   繁体   English

禁用通过手势滚动ScrollView

[英]Disable scrolling a ScrollView by gesture

how can I disable the scrolling of a Scrollview, by the user? 如何禁用用户对Scrollview的滚动? I want to scroll it by code 我想按代码滚动

To answer this question: 要回答这个问题:

I've done some research, and the following works the best: 我已经做过一些研究,以下工作效果最好:

scroll.setOnTouchListener(new OnTouchListener()
{ 
    public boolean onTouch(View v, MotionEvent event) 
    {
        return true; 
    }
});

As parsed from my working code. 从我的工作代码解析。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM