我能够通过创建一个包含线性布局的滚动视图来解决这个问题。在我的代码中,我以编程方式添加了HorizontalScrollView对象,如下所示:
https://github.com/vieux/Android-Horizontal-ListView
谢谢
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:focusable="true"
android:descendantFocusability="afterDescendants"
android:layout_marginTop="?android:attr/actionBarSize"
android:fillViewport="true">
<LinearLayout
android:id="@+id/listLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>