android scrollview组件禁止滑动的方法

时间:2021-01-27 10:53:08
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">
</<span style="line-height: 21px; ">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;
}
});