android - 如何在 AppBarLayout Android 中的 SearchView 的查询文本中删除下划线
问题描述
我在我的应用程序中使用 AppBarLayout 搜索小部件。一切正常,但我完全坚持在我的 AppBarLayout 中删除搜索字段下方的下划线。
以下是胡说八道的代码。它没有解决...
findViewById<View>(R.id.search_plate).setBackgroundColor(ContextCompat.getColor(context, android.R.color.white))
解决方案
我的回答迟了,但我希望它可以帮助任何人使用下一行找到 search_plate
findViewById<View>(androidx.appcompat.R.id.search_plate)
但请确保您在 xml 和活动中使用androidx.appcompat.widget.SearchView否则您将获得 Null Exception
推荐阅读
- flutter - 如何在 Android 的 Flutter/Dart 中重新缩放相机图像?
- reactjs - RangeError:使用 ES6 新 Map() 对象初始化反应状态值超出了最大调用堆栈大小
- python - OneHotEncoder 拟合错误 ValueError:无法将字符串转换为浮点数:b
- python - Python按包含的元素对数组进行排序?
- laravel - 重写规则不起作用,找不到返回 404
- javascript - 为什么 x 输出 onclick 等于被点击的列表索引?
- html - 将不同大小的图标相互对齐(字体真棒)
- python - 测试。检查脚本的每个部分(如果是块代码)的正确性
- datetime - 在颤动中将字符串转换为日期时间
- c# - Newtonsoft.Json CreateObjectUsingCreatorWithParameters 中的 ArgumentNullException