我在android studio(JAVA)的表单中有一个searchView,代码如下:
<SearchView
android:id="@+id/SView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:background="#52BFECF4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvSearchDesc"/>
要在此视图中键入任何内容,用户应准确触摸 searchView 中的放大镜图标,如果用户触摸其他任何位置,searchView 不会激活。
我需要它始终打开。
SearchView.setIconifiedByDefault(false);