我想实现一个 ListView ,其中每行包含一系列缩略图。我尝试了带有嵌入式画廊小部件的 ListView 。它不工作,没有显示任何内容。只是想知道我是否走在正确的道路上,或者我应该为这个布局使用不同的小部件。
第 1 行:Image1 Image 2 Image3 第 2 行:Image1 Image 2 Image3 等
谢谢。
最佳答案
我能够通过创建一个包含线性布局的 ScrollView 来解决这个问题。在我的代码中,我以编程方式添加了 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>
关于android - ListView 中的画廊小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11959614/