xml - how to create Android Burger Button with options icon? -
creating burger button multiple customized options in android. when click button, want show options corresponding icons (shown in image).
i used popupmenu how set icons in popupmenu options?
please me??
you can try using listpopupwindow , anchor burger button (in case aren't using actionbar)
http://developer.android.com/reference/android/widget/listpopupwindow.html
string [] items = new string[]{"item1" , "item2", "item3"}; view anchor= (button)findviewbyid(r.id.burgerbutton); anchor.setonclicklistener(new onclicklistener(){ showpopup(); }); public void showpopup() { listpopupwindow popup = new listpopupwindow(this); //replace adapter custom adapter , layout custom menu item popup.setadapter(new arrayadapter<string>(this, android.r.layout.simple_list_item_1, android.r.id.text1,items)); popup.setanchorview(anchor); popup.setwidth(200); popup.show(); }
Comments
Post a Comment