Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change search icon hint to right in SearchView

I have layout search.xml like this

<SearchView
                android:layout_margin="@dimen/size_8"
                android:iconifiedByDefault="false" // <--- always expand
                android:id="@+id/searchView"
                android:layout_width="match_parent"
                android:background="#fff"
                android:queryHint="@string/search"
                android:layoutDirection="rtl"
                android:layout_height="wrap_content"
                />

result :

enter image description here

I want to change search icon to right like picture bellow

enter image description here

How achieve like I want? Thanks.

like image 246
ltvie Avatar asked Oct 28 '25 06:10

ltvie


1 Answers

<android.support.v7.widget.SearchView
   android:id="@+id/searchView"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:clickable="true"
   android:layout_marginEnd="@dimen/_20sdp"
   android:layoutDirection="rtl"/>
like image 101
keval patel Avatar answered Oct 29 '25 20:10

keval patel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!