SearchView positions when expanded in ActionBar

北城以北 提交于 2019-12-13 09:23:18

问题


1.how can i get SearchView left,right,bottom,.. positions when it is expanded in Action Bar,and i am getting the values in normal position.

2.how can give my list of words as search suggestions for a searchview.


回答1:


You can use android:layout_centerInParent="true" to put searchview in center

<item  android:id="@+id/action_search"
    android:layout_centerInParent="true"
    android:actionViewClass="android.widget.SearchView"
    android:icon="@drawable/search_main"
    android:iconifiedByDefault="false"
    android:title="Search"/>


来源:https://stackoverflow.com/questions/19316113/searchview-positions-when-expanded-in-actionbar

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