Bottom Navigation Bar: Text size is increasing on pressing?
Try to add this code in dimens.xml
file
<dimen name="design_bottom_navigation_text_size" tools:override="true">10sp</dimen>
<dimen name="design_bottom_navigation_active_text_size" tools:override="true">10sp</dimen>
You can set the active and inactive textAppearance for a BottomNavigationView via styles:
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/BottomNavigationView"/>
Put below styles in styles.xml
file
<style name="BottomNavigationView">
<item name="itemTextAppearanceActive">@style/TextAppearance.BottomNavigationView.Active</item>
<item name="itemTextAppearanceInactive">@style/TextAppearance.BottomNavigationView.Inactive</item>
</style>
<!-- blank styles for better code readability-->
<style name="TextAppearance"/>
<style name="TextAppearance.BottomNavigationView"/>
<!-- inactive tab icon style -->
<style name="TextAppearance.BottomNavigationView.Inactive">
<item name="android:textSize">12sp</item>
</style>
<!-- active tab icon style -->
<style name="TextAppearance.BottomNavigationView.Active">
<item name="android:textSize">12sp</item>
</style>
With TextAppearance you can control more than just textSize
, but also properties such as fontFamily
, etc.