android 如何禁止scrollview 滚动

2020-07-09 社会 153阅读
android scrollview组件禁止滑动的方法;
xml配置:
android:id="@+id/sc_freement"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/category_line"
android:scrollbars="none"
android:fadingEdge="none">
</ScrollView>
java代码控制:
ScrollView scrollView = (ScrollView)this.findViewById(R.id.sc_freement);
scrollView.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
return true;
}
});
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com