Dropdown menu items with custom views Android showAsAction never

大城市里の小女人 提交于 2019-12-24 11:28:12

问题


I am looking for the right way to implement dropdown menu with custom menu items. Default menu provided by Action Bar or Toolbar suits great, I also need "three dots" in the right top corner of the screen. But the problem is that I can specify custom layout for menu item only if it is visible directly on action bar.
But in my case I need custom views for dropdown items, for example one item is divide other items has also different views that can be specified for each item, not for all (like using style generators).
Here is an example I have found here on stackoverflow, I need similar menu, as you can see here there are differen types of items checkboxes simple items......

I need at least something like trick with ListView or RecyclerView when depending on item type inflating different layout.

I am asking about this, because maybe it is possible to implement using default menu or if it isn't get advice what is the most efficient and right way to implement this without causing performance problems and not reinventing the wheel.

I would appreciate any help or advice.
Thank you.

来源:https://stackoverflow.com/questions/31760081/dropdown-menu-items-with-custom-views-android-showasaction-never

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!