我在我的应用中使用AppBarLayout搜索小部件。一切正常,但我完全无法删除AppBarLayout中搜索字段下方的下划线。
以下是废话代码。它没有解决...
findViewById<View>(R.id.search_plate).setBackgroundColor(ContextCompat.getColor(context, android.R.color.white))
尝试一下
val v = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
v.setBackgroundColor(Color.parseColor("Colour code"));
希望这对您有帮助