How to make any imagebutton a menu button
问题 I have an imageButton in a xml file. Now want to make it a menu button, so that when a user click on the button it should show the drop down menus. But I am not able to figure out what are the possible solution(s). Can anyone help? 回答1: If you're trying to show a drop down menu when clicking an ImageButton (or any other View ), try this: final ImageButton imageButton = // get your ImageButton from the XML here final PopupMenu dropDownMenu = new PopupMenu(getContext(), imageButton); final Menu