Search View Icon Position Change

旧街凉风 提交于 2019-12-23 12:37:35

问题


I have implemented a SearchView in a toolbar as shown in image below. Here, the search icon is on the right side of a cursor . And it gets invisible with the hint.

I want to shift the search icon on the left side of a cursor and also it should not get invisible with the hint. it should be in this order.. [ SearchIcon-Cursor-Hint ]

I want it like this image..

Can anyone please help me out... :(


回答1:


if you are using an edittext control, you can do it in the edittext as follows...

android:drawableLeft="@drawable/search"




回答2:


This one could help but required API 17

<SearchView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layoutDirection="rtl" />


来源:https://stackoverflow.com/questions/29968949/search-view-icon-position-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!