Thursday, 19 September 2013

changing the position of the search icon

changing the position of the search icon

I use SearchView in OptionsMenu:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_search"
android:title="Search"
android:icon="@drawable/icon_search"
android:showAsAction="always"
android:actionViewClass="android.widget.SearchView" />
</menu>
In main activity:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_search, menu);
View inflatedView = getLayoutInflater().inflate(R.layout.arrow,
null);
MenuItem searchItem = menu.findItem(R.id.action_search);
mSearchView = (SearchView) searchItem.getActionView();
setupSearchView(searchItem);
return (super.onCreateOptionsMenu(menu));
}
The search icon located on the right in menu. How to change its position
in my menu? I want that it is located left.

No comments:

Post a Comment