easycheese easycheese - 1 month ago 22
Android Question

Android Design Layout ListItem RecyclerView Horizontal

I am using the tools:listitem attribute to show my views in the design layout with a recyclerview. Problem is, they always show up in a vertical list. Is there a way to have the Design Layout Editor display them horizontally?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@android:layout/simple_list_item_checked"/>




enter image description here

I want the above image, displayed horizontally. IN THE DESIGN VIEW. NOT in the application itself, I know how to do that.

Answer

Please Check this code

   <android.support.v7.widget.RecyclerView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    app:layoutManager="android.support.v7.widget.LinearLayoutManager" />