Chris Palma
Chris Palma

Reputation: 223

Custom Style for Popup Menu

I am stuck with the problem on how to make a custom style for Popup Menu.

All I got is this kind of Popup Menu:

This is running on an Marshmallow emulator.

I don't have a custom style for this because I don't really know how to do it.

enter image description here

And here is my popup.xml file,

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item
    android:id="@+id/popupMenuEditItem"
    android:icon="@drawable/edit"
    android:title="Edit Item" />

<item
    android:id="@+id/popupMenuDeleteItem"
    android:icon="@drawable/fab_menu_delete"
    android:title="Delete Item" />

</menu> 

My goal is to have this popup menu,

enter image description here

Anyone know how to do it? I would really appreciate any help. Thanks! :)

Upvotes: 0

Views: 1014

Answers (1)

Anjali
Anjali

Reputation: 2535

you can have custom popup window in this case which will automatically get popup below or above view depending upon the clicked view position.

Reference link: https://developer.android.com/reference/android/widget/PopupWindow.html

Upvotes: 1

Related Questions