2016-07-27 78 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适配器类。