android - 删除底部导航 View 中图标的填充

标签 android navigationview bottomnavigationview

我正在尝试降低底部导航 View 中的图标。例如,现在他们像这样被压在顶线上。

See image here

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

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>

最佳答案

使用

bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);

app:labelVisibilityMode="unlabeled"

关于android - 删除底部导航 View 中图标的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44856730/

相关文章:

安卓标签 View

android - 如何将字符串项添加到列表?

swiftui - 如何在 SwiftUI NavigationLink 中移除不透明动画

navigation-drawer - 可以使用提供的参数调用以下函数。向上导航

java - Bottom Sheet 展开时最小化带有动画的底部导航栏

java - 具有BottomNavigationView的NavigationComponent查看项目选择

android - React Native Maps 和带有图像的标注

java - 无法启动 Activity ComponentInfo {com.example.list/com.example.list.editbox} : java. lang.NullPointerException

java - 图标和 NavigationView 之间的左边距

ios - SwiftUI 在用户导航到它们之前创建目标 View