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!

Vladimir Ivanov
  • 42,730
  • 18
  • 77
  • 103
Mikhail
  • 398
  • 2
  • 15
  • trying to adopt http://stackoverflow.com/questions/1532876/android-combining-text-image-on-a-button-or-imagebutton/3734246#3734246 – Mikhail Mar 16 '11 at 14:33

1 Answers1

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

Mikhail
  • 398
  • 2
  • 15
  • 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 ? – Shark Jun 21 '12 at 05:47