在底部导航栏中,即使我选择了该图标,该图标也不会突出显示。如何更改它?

时间:2018-07-10 04:52:04

标签: java android bottomnavigationview

默认情况下,每个活动中只有主页图标会突出显示。

  1. 如何更改选中图标的突出显示?
  2. 如何更改默认的突出显示图标?
  3. 在哪里更改 <script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script> <div id="box-select"> <select @change="onChange($event.target.value)"> <option is="my-row" v-for="item in items" v-bind:title="item.title" v-bind:value="item.id" > </option> </select> <!-- <view-option v-for="item in items" :item="item" :key="item.id"></view-option> --> {{newTodoText}} </div>activity_main.xml或菜单xml文件?

按下登录图标,但主页变亮: selector.xml

MainActivity.java

activity_main.xml

nav_items.xml-menu item I pressed the second icon,activity is changed but still home is getting highlighted in emulator

1 个答案:

答案 0 :(得分:1)

尝试一下

在类似

的可绘制文件夹中添加selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/beyaz" android:state_enabled="true" />
<item android:color="@color/colorPrimaryDark" android:state_enabled="false" />
</selector>

在activity_main.xml中添加app:itemIconTint="@drawable/selector"

 <android.support.design.widget.BottomNavigationView

    app:itemIconTint="@drawable/selector"

    />