material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.37k stars 3.07k forks source link

[BottomNavigationView] android:minHeight is not working #2607

Open malloth opened 2 years ago

malloth commented 2 years ago

Description:

Put BottomNavigationView with height set to wrap_content. View is not displayed at all. To overcome this you need to explicitly set any height to this view.

Expected behavior:

BottomNavigationView with height set to wrap_content should use its android:min_height attribute from the style.

Source code:

<com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/bottom_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:menu="@menu/menu_bottom_navigation" />

Minimal sample app repro: N/A

Android API version: 22

Material Library version: 1.5.0

Device: PAX A920

Farid-Moghaddam-us commented 2 years ago

write this code in style.xml file:

<style name="Widget.BottomNavigationView" parent="Widget.Design.BottomNavigationView">
        <item name="android:minHeight">0dp</item>
    </style>