How to specify list item count in preview of recyclerview in Android Studio?

shakdwipeea picture shakdwipeea · Jan 21, 2017 · Viewed 11.2k times · Source

The recyclerview layout is defined as

     <android.support.v7.widget.RecyclerView
            android:layout_marginTop="15dp"
            android:id="@+id/call_detail_list"
            android:scrollbars="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:listitem="@layout/call_item"
            />

In the preview, I can see the list items from the specified layout, but the number of item is 10. Is there any way that can be changed?

Answer

Diego Alvis picture Diego Alvis · Oct 24, 2017

Try this (3 number of items)

tools:itemCount="3"