PopupMenu Item Icons

后端 未结 1 1769
渐次进展
渐次进展 2021-01-15 13:12

I have a problem with my app. I need to show a PopupMenu and I need every item in this menu to contain text and an image. The images should be displayed to the

相关标签:
1条回答
  • 2021-01-15 13:33

    Unfortunately PopupMenu does not support icons by default.

    Alternatives include creating your own class which extends PopupMenu or more simply switching to using an ActionBar. There is a GitHub repository for an Android Compatibility popup menu with icons, which might be helpful.

    Of the three options I would suggest going with the ActionBar because android seem to be heavily pushing the use of the ActionBar as best practice over the traditional header menus in their guides.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题