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

时间:2017-07-01 02:01:58

标签: android navigationview bottomnavigationview

我试图让底部导航视图中的图标更低。例如,现在他们就像这样按下顶线。

See image here

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

的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>

1 个答案:

答案 0 :(得分:0)

使用

bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);

app:labelVisibilityMode="unlabeled"