0

There is a (Menu menu) which I've already filled with MenuItems. There is also custom dialog, which I want to use instead of standart OptionMenu. I decided to use Button instead of ItemMenuView in it.

So I fill my custom dialog with Buttons, add the icon and the text of MenuItem to every Button and as a result get a completly awful 'Menu'.

My question is, describe please step by step how to make a common Button (or not a Button) looks like a common MenuItemView.

Thaks in advance!

1

1 Answer 1

1

That's turned up pretty enough for me:

<ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.33" android:id="@+id/menu_btn1" android:background="@drawable/custom_button" android:src="@drawable/menu_btn1" /> 

where drawable/custom_button I left empty and drawable/menu_btn1 represents common selector with pressed/enadled states

Sign up to request clarification or add additional context in comments.

1 Comment

hey i want to make every item in my ListView look like a button should this code help me, ? I would've tried it out but i dont understand where to put this.. is this a drawable xml ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.