我无法删除 android studio 中导航视图图标下方的空间。代码有什么问题吗?

问题描述 投票:0回答:1
java android xml
1个回答
0
投票

使用下面的代码并使用相对布局而不是线性布局。

<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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/nav_view"
        android:background="#6000BCD4"
        app:elevation="4dp"
        app:labelVisibilityMode="auto"
        app:itemHorizontalTranslationEnabled = "false"
        android:layout_alignParentBottom="true"
        app:itemIconSize="23sp"
        app:menu="@menu/bottom_nav_menu"/>
    
</RelativeLayout>
© www.soinside.com 2019 - 2024. All rights reserved.