in my MainActivity, in onCreateOptionsMenu
method, I inflate a basic menu with four items (see menu_main.xml).
As it is possible to have rounded corners in DialogFragments, how can I get rounded corners for this menu?
As you can see in the screenshot, the menu appears as an overflow menu on top of the whole Activity (yes, the basic menu that Android gives you when tapping the three dots).
Screenshot here: MainActivity with menu opened
WHAT I TRIED
as for the Dialog, I added android:background="@drawable/basic_rounded_corners
to both the menu and the item nodes in menu_main.xml ---> not working (cause I don't know how to set the backgroundDrawable of the menu programmatically, if it is even possible like for the DialogFragments)
WHAT I WANT
I want to know how to get rounded corners on my menu.
menu_main.xml
<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="com.beagleentertain.pillreminder.MainActivity"
android:background="@drawable/basic_rounded_corners">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/checkable_make7dayspause"
android:checkable="true"
android:checked="false"
app:showAsAction="ifRoom"
/>
<item
android:id="@+id/about_settings"
android:orderInCategory="100"
android:title="@string/text_menu_about"
app:showAsAction="ifRoom"
/>
<item
android:id="@+id/settings_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="ifRoom"
/>
<item
android:id="@+id/settings_share"
android:orderInCategory="100"
android:title="@string/action_share"
app:showAsAction="ifRoom"
/>