How to use androidx.recyclerview.widget.RecyclerView
with tools:listitem
?
I have this layout:
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recyclerViewActors"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
tools:listitem="@layout/list_item_actor"
tools:itemCount="5"
tools:orientation="horizontal"
tools:scrollbars="horizontal"
tools:spanCount="2"/>
but Design tab doesn't show preview:
And if I change androidx.recyclerview.widget.RecyclerView
in this layout to ListView
, the preview works:
tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
in my code I have the same issue (don't see my items) so you can remove it if is not needed – Flynnjava.lang.ClassNotFoundException: androidx.recyclerview.widget.GridLayoutManager
can explain why you can't have the display. So he can't display because he not find this – Flynnimplementation 'androidx.recyclerview:recyclerview:1.0.0-beta01'
orimplementation 'androidx.recyclerview:recyclerview:1.0.0-alpha1'
because when I use alpha I can see but when I change I don't see preview – Flynn