Chrome-like display of menu

不想你离开。 提交于 2019-12-22 12:14:48

问题


I'm trying to find some information on how to create a menu that looks like the top of the menu for chrome for Android. I have tried experimenting with implementing icons for Android 4.0, but no luck. Tried googeling, but the only thing i found was an answer that said icons can't be implemented when API >= 11.

How does Chrome do it then? It's made for devices that's 4.0+!


回答1:


Use popup list window to achieve this. As you can add header and footer to any list, you can create one linear layout with back forward and star like options.. Add that view to the popup window.




回答2:


Any ListView can be associated with HeaderViewListAdapter, using this you can attach seperate layouts as a header and or footer to your listViews.

As Vinodkumar said, you can also use ListPopupWindow with HeaderViewListAdapters.

In the Android reference: HeaderViewListAdapter and ListPopupWindow



来源:https://stackoverflow.com/questions/11908908/chrome-like-display-of-menu

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