
image.png
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#5c5050" />
<corners android:radius="20dp" />
</shape>
(这是v7下的SearchView)
<android.support.v7.widget.SearchView
android:id="@+id/serachview"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="10dp"
android:background="@drawable/yuan"
app:iconifiedByDefault="false" />(这行是取出下滑线的作用)
//显示搜索框控件
searchView = (SearchView) findViewById(R.id.serachview);
//设置查询提示字符串
searchView.setQueryHint("请输入搜索内容");
//设置搜索图标是否显示在搜索框内
searchView.setIconifiedByDefault(false);

image.png
网友评论