0

I created this layout using the Android Studio wizard, but I want to change the width of the options menu to reduce its size and remove the red space marked on the image.

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
    android:id="@+id/action_settings"
    android:orderInCategory="0"
    android:title="@string/action_settings"
    app:showAsAction="never" />
<item
    android:id="@+id/action_about"
    android:orderInCategory="1"
    android:title="@string/settings_about"
    app:showAsAction="never" />
<item
    android:id="@+id/action_logout"
    android:orderInCategory="2"
    android:title="@string/settings_logout"
    app:showAsAction="never" />
<item
    android:id="@+id/action_help"
    android:orderInCategory="3"
    android:title="@string/settings_help"
    app:showAsAction="never" />

In red I point out the space I want to reduce.

Options menu screenshot

rafsanahmad007
  • 23,683
  • 6
  • 47
  • 62
adriandleon
  • 110
  • 1
  • 8

1 Answers1

1

You need to create a style for the menu: Take a look at the answer here: https://stackoverflow.com/a/21618167/1618363

Basically you need to:

  • Make a row layout.
  • Initialize the window
  • Call it in the onCreate() method
Ushal Naidoo
  • 2,704
  • 1
  • 24
  • 37