如何删除如图所示的下划线?将其设置为透明或更改背景无济于事。
已经尝试过以下解决方案:How to remove white underline in a SearchView widget in Toolbar Android
将样式都更改为actionbar-searchview,并以编程方式进行。更改querybackground的问题是它将忽略我已经设置的可绘制背景。
<SearchView
android:id="@+id/searchViewBar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
android:focusable="true"
android:queryHint=" "
/>
尝试以下代码:
View v = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
v.setBackgroundColor(Color.parseColor("here give actionbar color code"));