How to change background color popup menu android

后端 未结 12 2461
北恋
北恋 2020-11-29 03:47

I generate each option of menu from querying database. Here is my code.

final PopupMenu popupMenu = new PopupMenu(getBaseContext(), v); 
SQLiteDatabase db =          


        
12条回答
  •  清歌不尽
    2020-11-29 04:08

    at first define your style for popup menu background in styles.xml file in my case i use this...

    
    
    

    here i want to change popup menu background in a specific activity , so apply theme(android:theme="@style/AppTheme") with activity declaration and it's surely working. another important thing to create popup menu using this code PopupMenu popup = new PopupMenu(your activity, viewObj);

提交回复
热议问题