android踩坑日记

landcareweb.com编程问题网站

代码实现

SearchView search = (SearchView) item.getActionView(); 
    search.setLayoutParams(new ActionBar.LayoutParams(Gravity.RIGHT)); 

xml实现

 1 <RelativeLayout
 2         android:id="@+id/not"
 3         android:layout_width="wrap_content"
 4         android:layout_height="wrap_content"
 5         tools:ignore="MissingConstraints">
 6         <android.support.v7.widget.SearchView
 7             android:layout_alignParentRight="true"
 8             android:layout_width="wrap_content"
 9             android:layout_height="wrap_content" />
10 </RelativeLayout>
posted @ 2019-05-21 16:25  柯西丶不是你  阅读(294)  评论(0编辑  收藏  举报