2016-07-27 75 views
-5

Hello! I want to use same listview or gridview or nested recyclerview but I do not know how to implement this. please help me如何在android中創建嵌套的回收站視圖?

+4

你好,歡迎來到StackOverflow。請花一些時間閱讀幫助頁面,尤其是名爲[「我可以詢問什麼主題?」(http://stackoverflow.com/help/on-topic)和[「我應該問什麼類型的問題避免問?「](http://stackoverflow.com/help/dont-ask)。更重要的是,請閱讀[Stack Overflow問題清單](http://meta.stackexchange.com/q/156810/204922)。您可能還想了解[最小,完整和可驗證示例](http://stackoverflow.com/help/mcve)。 – yennsarah

+0

這不是一個嵌套的回收站視圖。一個簡單的回收站視圖,連續3個圖像瀏覽。 –

回答

0

創建一個xml文件,它是一個線性佈局,並將線性佈局的方向屬性設置爲水平。 對於例如,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:weightsum="3"> 
    <ImageView 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1"/> 
    <ImageView 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1"/> 
    <ImageView 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1"/> 
</LinearLayout> 

,並把這種佈局recyclerView適配器類。