How to change background color popup menu android

后端 未结 12 2466
北恋
北恋 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 03:56

    Please Refer How to style PopupMenu? for more explanation. I was facing the same issue, searched alot but found the solution in the link mentioned.

    PopupMenu is created in following way :

    PopupMenu popup = new PopupMenu(context, view);
    

    PopupMenu takes the styling of the context which is passed, Passing Activity as the context solved my problem.

提交回复
热议问题