I have a search view and I have a query hint attribute. However the hint appears only after clicking on the search view. Is there a way to make it appear before it has been clicked?
<SearchView
android:id="@+id/searchView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/textView4"
android:layout_marginBottom="14dp"
android:layout_marginTop="30dp"
android:queryHint="Search" />
I have seen another SO question with a similar query, but it wasn't solved. That's why I am asking again.
Use this XML:
android:queryHint="hint"
app:queryHint="hint"
app:defaultQueryHint="hint"
android:iconifiedByDefault="false" // this line
app:iconifiedByDefault="false"
app used for {android.support.v7.widget.SearchView}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With