根据您提供的代码,我注意到您的'BottomNavigationView'的宽度设置为'wrap_content',这可能导致菜单项的名称无法显示出来。

请尝试将'BottomNavigationView'的宽度设置为'match_parent',并将'app:layout_constraintBottom_toBottomOf'属性改为'app:layout_constraintTop_toBottomOf',以确保它占据整个父容器的宽度并与父容器顶部对齐。同时,您还可以尝试调整菜单项的文本颜色和大小,以确保它们能够正确显示。修改代码如下:

<com.google.android.material.bottomnavigation.BottomNavigationView
    android:id="@+id/bottomNavigationView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:itemIconTint="#6AF321"
    app:itemTextColor="#28F321"
    app:layout_constraintTop_toBottomOf="@id/home_fragment"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:menu="@menu/bottom_menu" />

如果问题仍然存在,请提供更多关于布局和相关代码的信息,以便更好地帮助您解决问题。非常抱歉给您带来的困扰,我会尽力提供正确的解决方案。

Android BottomNavigationView 菜单项名称无法显示的解决方法

原文地址: http://www.cveoy.top/t/topic/EXW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录