android - Where does ContextMenu get its layout from? -
i'm following official android tutorial guide create context menu when listview long clicked. http://developer.android.com/guide/topics/ui/menus.html#xml
everything works out, contextmenu has strange margin , text color of header set blue, color never used in app before.
i want know context menu getting information set margins , text color? it's not default settings of context menu.
i think layout of context menu depends upon android version using. if want customize menu should create layout in res->menu , inflate yourself.
like this:
@override public void oncreatecontextmenu(contextmenu menu, view v, contextmenuinfo menuinfo) { super.oncreatecontextmenu(menu, v, menuinfo); menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.context_menu, menu); } you can refer same doc custom context menu.
Comments
Post a Comment