Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase Bottom Navigation View height along with its icon and text sizes in android?

Tags:

I am using

compile 'com.android.support:design:25.0.0' 

Android Bottom Navigation View and its height is is fixed and tiny icons with small text are shown. My question is how can i increase their sizes? I've tried to change size in xml file through style... all other properties are working except textsize property.

Can i do that pragmatically if so, then please write a code

like image 897
Ramsha Omer Avatar asked Feb 18 '17 18:02

Ramsha Omer


People also ask

What is the height of bottom navigation bar android?

Because snackbars have a lower (6dp) elevation, they appear behind the bottom navigation bar (8dp elevation).

How do I adjust the navigation bar at the bottom?

To create a Menu Resource File , click on the app -> res -> menu(right-click) -> New -> Menu Resource File and name it bottom_nav_menu. Now the user can create as many items as he wants in the bottom_nav_menu. xml file. The user also needs to create an icon for each of these items.


2 Answers

I've found a solution to override some dimen values in dimens.xml file it works for the text size but icon still remains tiny. Here is how i do that. Hope this code will help others too :-)

<!-- Overriding Default Bottom Navigation sizes-->     <dimen name="design_bottom_navigation_text_size" tools:override="true">16sp</dimen>     <dimen name="design_bottom_navigation_active_text_size" tools:override="true">20sp</dimen>     <dimen name="design_bottom_navigation_height" tools:override="true">70dp</dimen> 
like image 144
Ramsha Omer Avatar answered Oct 03 '22 02:10

Ramsha Omer


To expand on RamshaS answer for those who are looking to increase other values as well. Here are a list of all the values that can be set

bottom_navigation_elevation bottom_navigation_height bottom_navigation_icon bottom_navigation_margin_bottom bottom_navigation_margin_top_active bottom_navigation_margin_top_inactive bottom_navigation_max_width bottom_navigation_min_width bottom_navigation_notification_elevation bottom_navigation_notification_height bottom_navigation_notification_margin_left bottom_navigation_notification_margin_left_active bottom_navigation_notification_margin_top bottom_navigation_notification_margin_top_active bottom_navigation_notification_margin_top_classic bottom_navigation_notification_padding bottom_navigation_notification_radius bottom_navigation_notification_text_size bottom_navigation_notification_width bottom_navigation_padding_left bottom_navigation_padding_right bottom_navigation_small_active_max_width bottom_navigation_small_active_min_width bottom_navigation_small_inactive_max_width bottom_navigation_small_inactive_min_width bottom_navigation_small_margin_bottom bottom_navigation_small_margin_top bottom_navigation_small_margin_top_active bottom_navigation_small_selected_width_difference bottom_navigation_text_size_active bottom_navigation_text_size_forced_active bottom_navigation_text_size_forced_inactive bottom_navigation_text_size_inactive 
like image 29
Kobus Pitzer Avatar answered Oct 03 '22 02:10

Kobus Pitzer