adelriosantiago
adelriosantiago

Reputation: 8124

How do I change the size of the navigation drawer menu item icons?

How do I change the size of the <item> elements inside a Navigation Drawer element?

No matter what the icons always seem to resize automatically to 24dp like this:

enter image description here

I need to increase the size of the icons to 34 dps but the <item> elements don't seem to have any attribute to change this setting in the XML:

enter image description here

Thanks.

Upvotes: 2

Views: 8512

Answers (3)

Rodrigo Givisiez
Rodrigo Givisiez

Reputation: 69

You can change the size of navigationView icon by overriding design_navigation_icon_size attribute. You can put it in dimens and because you're overriding a private attribute, you need to include tools:override="true"

<dimen name="design_navigation_icon_size" tools:override="true">40dp</dimen>

Upvotes: 5

shiv
shiv

Reputation: 459

copy this in your Navigation drawer xml.

app:itemTextAppearance="@style/TextAppearance.AppCompat.Display1"

there are many text appearence to choose from.

Upvotes: 1

ianhanniballake
ianhanniballake

Reputation: 199805

NavigationView implements the material design specs for a navigation drawer. Therefore the size of the icons are fixed at 24dp. You'd have to build your own navigation drawer to break the material design specs if you want 34dp icons.

Upvotes: 0

Related Questions