删除底部导航视图中图标的填充

Jef*_*hou 5 android navigationview bottomnavigationview

我试图将底部导航视图中的图标调低。例如,现在它们像这样按在顶行上。

在这里查看图片

我如何降低图标?我希望它们在底部导航视图中垂直居中。

xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
tools:context="com.example.jchousurface.mastertrack.homescreen">

<FrameLayout
    android:id="@+id/content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1">
</FrameLayout>

<android.support.design.widget.BottomNavigationView
    android:id="@+id/navigation"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="#FFFFFF"
    app:menu="@menu/navigation" />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

UgA*_*0FF 3

使用

bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);
Run Code Online (Sandbox Code Playgroud)

或者

app:labelVisibilityMode="unlabeled"
Run Code Online (Sandbox Code Playgroud)