Android SDK有两个滚动组件,HorizontalScrollView和ScrollView。一个是水平滚动,另一个是垂直滚动。两个嵌套使用,可实现水平和垂直滚动。
本文转自:http://hi.baidu.com/laoyang1018/blog/item/b34b241f3c7b44d6a78669b1.html
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content">
<HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
<RelativeLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<!-- 此处省略的组件的配置 -->
... ...
</RelativeLayout>
</HorizontalScrollView>
</ScrollView>