Remove padding for icons in bottom navigation view
Asked Answered
L

2

6

I'm trying to make the icons in a bottom navigation view lower. For example, right now they are pressed against the top line like this.

See image here

How would I make the icon lower? I want them to be centered vertically in the bottom navigation 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>
Lita answered 1/7, 2017 at 2:1 Comment(4)
Can you post the xml code please ?Malindamalinde
Sure, its nothing special though, just the basic navigation viewLita
@Malindamalinde just editedLita
Possible duplicate of How to disable BottomNavigationView shift mode?Teddy
T
3

use

bottomNavigationView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_UNLABELED);

or

app:labelVisibilityMode="unlabeled"
Teddy answered 20/7, 2018 at 12:41 Comment(0)
W
0

change attribute android:layout_height="40dp" or lower in BottomNavigationView

Whitfield answered 17/11, 2021 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.