底部导航所选项目突出显示

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

我在使用 kotlin 的 Android 中使用底部导航菜单时遇到问题 我无法禁用所选项目的图标突出显示,任何人都可以帮助我吗?

enter image description here

我搜索了网络,但找不到任何隐藏底部导航菜单中图标周围突出显示的解决方案

android kotlin bottomnavigationview
1个回答
0
投票

如果您使用 xml:

val bottomNavigationView: BottomNavigationView = findViewById(R.id.bottomNavigationView)
bottomNavigationView.itemActiveIndicatorColor = getColorStateList(R.color.black)

用于撰写

NavigationBarItem
的设置颜色:

colors = NavigationBarItemDefaults.colors(indicatorColor = Color.Black)
© www.soinside.com 2019 - 2024. All rights reserved.