1

我想实现一个列表视图,其中每行包含一系列缩略图。我尝试了一个带有嵌入式画廊小部件的列表视图。它不起作用,没有显示任何内容。只是想知道我是否走在正确的道路上,还是应该为此布局使用不同的小部件。

第 1 行:图像 1 图像 2 图像 3 行 2:图像 1 图像 2 图像 3 等。

谢谢。

4

2 回答 2

1

我能够通过创建一个包含线性布局的滚动视图来解决这个问题。在我的代码中,我以编程方式添加了 Horizo​​ntalScrollView 对象,可在此处找到:https ://github.com/vieux/Android-Horizo​​ntal-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>
于 2012-08-20T17:43:53.670 回答
0

您可以尝试将水平滚动视图放在列表视图中。

于 2012-08-14T21:14:23.213 回答