3

我使用如何在android中增加底部導航視圖高度及其圖標和文字大小?

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

的Android底部導航視圖以及其高度是固定的,與小文的小圖標顯示。 我的問題是我如何增加他們的尺寸? 我試圖通過樣式更改xml文件的大小...除textsize屬性外,所有其他屬性都在工作。

我可以做到務實,如果是這樣,那麼請寫一個代碼

回答

9

我已經找到了解決方案,覆蓋dimens.xml文件時,它適用於文本大小,但圖標仍然存在一些微小捫值。 以下是我如何做到這一點。希望這個代碼將會幫助別人太:-)

<!-- 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> 
+0

工作!謝謝@RamshaS –

+0

歡迎您:-) – RamshaS

4

要在RamshaS答案擴大那些誰正在尋找增加其它值。這裏列出所有可以設置的值

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 
相關問題