我正在尝试在我的应用程序中添加搜索栏,但遇到了“无法解析类SearchView”的错误。由于谷歌没有提供帮助,因此我来到这里。这是我的代码:
<SearchView
android:layout_width="410dp"
android:layout_height="44dp"
android:layout_marginEnd="1dp"
android:layout_marginBottom="2dp"
app:layout_constraintBottom_toTopOf="@+id/grid_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
其余的xml都是正确的,我直接从Android获取了小部件,所以这让我感到困惑。非常感谢所有的帮助。