Android BottomNavigationView elements displaying without text and layout not hiding in scroll

Hi guys I implemented the design library BottomNavigationView . It works fine, but I don’t know why the menu icon does not appear with text, and I want it to hide with a scroll down, like Floating Action Button . But I did not find a way to do this. I read the developer docs , but I did not find a solution to my problem.

Here is my conclusion - Item Display only text that is not included

Expected Result - Each element should be with an image and text.

Here is my xml code

 <android.support.design.widget.BottomNavigationView android:id="@+id/bottom_navigation" android:layout_width="match_parent" android:layout_height="wrap_content" app:itemBackground="@android:color/white" app:itemIconTint="@drawable/nav_color_state_list" app:itemTextColor="@drawable/nav_color_state_list" android:layout_alignParentBottom="true" app:menu="@menu/bottom_navigation_menu" /> 

nav_color_state_list.xml drawable Code

 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/colorAccent" android:state_checked="true" /> <item android:color="@color/textColorSecondary" android:state_checked="false" /> </selector> 

bottom_navigation_menu.xml

 <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_home" android:title="Home" android:icon="@drawable/home_black_36dp" app:showAsAction="ifRoom|withText"/> <item android:id="@+id/menu_notification" android:title="Notifications" android:icon="@drawable/add_alert_black_36dp" app:showAsAction="ifRoom|withText"/> <item android:id="@+id/menu_call" android:title="Call" android:icon="@drawable/comment_black_36dp" app:showAsAction="ifRoom|withText"/> <item android:id="@+id/menu_more" android:title="More" android:icon="@drawable/more_horiz_black_36dp" app:showAsAction="ifRoom|withText"/>> </menu> 
+8
android bottomnavigationview
source share
1 answer

I use this library, this is a great extension!

https://github.com/ittianyu/BottomNavigationViewEx

BottomNavigationViewEx bnve = (BottomNavigationViewEx) findViewById (R.id.bnve);

bnve.enableAnimation (false);

bnve.enableShiftingMode (false);

bnve.enableItemShiftingMode (false);

bnve.setIconSize (widthDp, heightDp);

bnve.setTextSize (SP);

+8
source share

All Articles