首页 > 解决方案 > 我的导航栏上的第一个图标是蓝色的,并且比其他图标大,我该如何更改?

问题描述

Android Studio 的全新用户在这里,我正在尝试将电影评论应用程序作为学校项目。

所以这里的问题是我主页的导航栏上会有几个图标,但由于某种原因,第一个图标总是蓝色并且比其他图标大,我不知道如何解决这个问题,正如你在图片。图片

这是我的 homepage.xml 和 nav_items.xml 的 XML

主页

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    tools:context=".Homepage">

    <android.support.design.widget.BottomNavigationView
        android:layout_width="match_parent"
        android:layout_height="68dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentStart="true"
        app:menu="@menu/nav_items"></android.support.design.widget.BottomNavigationView>
</RelativeLayout>

导航项.XML

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:icon="@drawable/ic_input_black_24dp"
        android:title="@string/nav_list" />
    <item
        android:icon="@drawable/outline_home_black_24"
        android:title="@string/nav_home" />
</menu>

标签: javaandroidandroid-layoutandroid-studioandroid-fragments

解决方案


如果默认为蓝色,则表示已选中。


推荐阅读