-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

Devid Farinelli
  • 7,514
  • 9
  • 42
  • 73
Mina
  • 1
  • 4
    Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – yennsarah Jul 27 '16 at 06:52
  • This isn't a nested recycler view. A simple recycler view with 3 imageviews in a row. – Muhammad Babar Jul 27 '16 at 06:52

1 Answers1

0

create an xml file which is a linear layout and set the orientation property of the linear layout to horizontal. For eg,

<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>

and call this layout in recyclerView adapter class.

Sohail
  • 303
  • 1
  • 10