android - onCreateOptionsMenu for imageview -


I am an Android app that tablet

I have a Gridwuv a view pager I I want to do this, I want to add a menu to imageview like Google in Gridview

Please refer to this image for reference

I have to keep it Try Div>

You must use PopupMenu :

a Popapmenu setup is required to pay as an anchor + menu recourse to specify which will be used here of course it is a OnClickListener to view it < Should be done inside / code>.

  anchorView.setOnClickListener (new OnClickListener () {Do @Override on public void (views) {Popapmenu Popapmenu = new Popapmenu (reference Ankrviv); Popapmenu Ksetonmenuitemkliklist (new Popapmenukonmenuitlklilistr () {public boolean Prmanuitemklik (Menuitm item) {switch (Aitet. Aitimaidi ()) {case Arkaidkaitim_on: // item one click return true; case R.id.item_two: // item Click returns True;} Mr. false;}); Popapmenu. (.   

Define a standard Menu resources - this is your popup_menu.xml :

  Menu xmlns: android = "http://schemas.android.com/apk/res/android" & gt; Item Android: id = "@ + id / item_one "android: title =" before a "/ & gt; & Lt; before android: id =" @ + id / item_two "android: title =" before two "/ & gt; & Lt; / menu & gt;   


Here's a nice tutorial you can view:


Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -