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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -