D
D
Daniel Khaliulin2016-04-15 17:29:19
Java
Daniel Khaliulin, 2016-04-15 17:29:19

How to change padding and margin values ​​of menu items?

Can you please tell me how to change the distances (padding and margin) of the elements in the menu? I need to reduce them. standard distances are too big for the application.
I create the menu like this:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">

    <item android:id="@+id/menu_contents"
        android:title="@string/menu_contents"
        android:icon="@drawable/ic_format_list_numbered"
        android:orderInCategory="2"
        app:showAsAction="always" />

    <item android:id="@+id/menu_search"
        android:title="@string/menu_search"
        android:icon="@drawable/ic_search"
        android:orderInCategory="100"
        app:showAsAction="always" />

    <item android:id="@+id/menu_favorite"
        android:title="@string/menu_favorite"
        android:orderInCategory="100"
        app:showAsAction="never" />

    <item android:id="@+id/menu_settings"
        android:title="@string/menu_settings"
        android:orderInCategory="100"
        app:showAsAction="never" />
</menu>

Thank you very much in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
A person from Kazakhstan, 2016-04-15
@LenovoId

there is only markup - there is no design code

Y
Yaroslav Morya, 2016-05-04
@morya_yaroslav

Here on SO:
1. One
2. Two

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question