Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searchview widget : move search icon to right

I have this searchView and i want to move the search icon to the right(if possible) enter image description here

my xml code:

 <android.widget.SearchView
    android:id="@+id/searchBox"
    android:layout_width="match_parent"
    android:layout_height="40dp"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginBottom="7dp"
    android:layout_below="@+id/header"
    android:iconifiedByDefault="false"
    android:background="@drawable/searchrectangle"
    android:queryHint="@string/search_message">

</android.widget.SearchView>
like image 681
AlinaBM Avatar asked Jan 24 '26 13:01

AlinaBM


1 Answers

I hope this work. It works for me.

android:layoutDirection="rtl"
like image 137
Irfaan Parrahoo Avatar answered Jan 27 '26 02:01

Irfaan Parrahoo



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!