2012-08-14 18 views
1

我想實現一個列表視圖,其中包含每行上的一系列縮略圖。我嘗試過使用嵌入式圖庫小部件的列表視圖。它不工作,沒有任何顯示。只是想知道我是否在正確的道路上,或者我應該爲這種佈局使用不同的小部件。列表視圖中的圖庫小部件

行1:IMAGE1圖像2的Image3 第2列:IMAGE1圖像2的Image3 等

感謝。

回答

1

我能夠通過創建包含線性佈局的滾動視圖來解決此問題。在我的代碼中,我以編程方式添加了Horizo​​ntalScrollView對象,在這裏找到: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> 
0

您可以嘗試在列表視圖內放置水平滾動視圖。

+0

水平滾動視圖不採取適配器,我不知道每行上會出現的縮略圖的數量,任何其他的想法? – user922295 2012-08-16 14:30:29

+0

我不認爲有任何其他方式,您將不得不創建自定義水平滾動列表視圖。嘗試在谷歌上查找,我相信一些偉大的頭腦必須已經做到了。 – 2012-08-16 15:08:05

相關問題