本文实例讲述了Android实现Activity水平和垂直滚动条的方法。分享给大家供大家参考,具体如下:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" > <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > </LinearLayout> </HorizontalScrollView> </ScrollView>
根标签是ScrollView下面的子标签是HorizontalScrollView,然后HorizontalScrollView下面就是你自己的布局了。
Ps:Scrollview和HorizontalScrollView标签下面都只能嵌入一个标签
希望本文所述对大家Android程序设计有所帮助。
【Android实现Activity水平和垂直滚动条的方法】相关文章:
★ android listview 水平滚动和垂直滚动的小例子
★ Android解决dialog弹出时无法捕捉Activity的back事件的方法
★ Android编程之客户端通过socket与服务器通信的方法