如何在AppBarLayout Android中删除SearchView的查询文本中的下划线

问题描述 投票:1回答:1

我在我的应用中使用AppBarLayout搜索小部件。一切正常,但我完全无法删除AppBarLayout中搜索字段下方的下划线。

以下是废话代码。它没有解决...

findViewById<View>(R.id.search_plate).setBackgroundColor(ContextCompat.getColor(context, android.R.color.white))
android kotlin searchview android-appbarlayout
1个回答
0
投票

尝试一下

val v = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
v.setBackgroundColor(Color.parseColor("Colour code"));

希望这对您有帮助

© www.soinside.com 2019 - 2024. All rights reserved.