怎么androidx.recyclerview.widget.RecyclerView
用tools:listitem
?我有这个布局:
<?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"/>
但设计选项卡不显示预览:
如果我androidx.recyclerview.widget.RecyclerView
将此布局更改为ListView
,则预览有效: