android禁止滚动
① Android 滚动条 ProgressBar 怎么停止
您好,很高兴能帮助您
如果你把内容包含在ScrollView中,当内容超出高度时会自动出现滚动条。
另外,使用控件HorizontalScrollView 来包住你的内容时,
如果你的内容假设是一个LinearLayout, 那么当LinearLayout的宽度超过屏幕时, 将会自动产生滚动条,当你拖动鼠标时,效果跟scrollView一样,不过是横向而己
例:
纵向滚动
<ScrollView>
<LinearLayout ........>
<TextView ...../>
<TextView ...../>
<TextView ...../>
<TextView ...../>
</LineraLayout>
</ScrollView>
模向滚动
<HorizontalScrollView >
<LinearLayout ........>
<TextView ...../>
<TextView ...../>
<TextView ...../>
<TextView ...../>
</LineraLayout>
</HorizontalScrollView >
有时候甚至可以做到横向纵向都支持,只需要你合理设计就可以, 注意ScrollView中只能加一个控制,不能超过两个
你的采纳是我前进的动力,
记得好评和采纳,答题不易,互相帮助,
② android 如何禁止scrollview 滚动
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">
</<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;
}
});