Shnkc
Shnkc

Reputation: 2158

How to design menuitem view with icon and text on action bar

The action mode has a menu with one menuitem which is specialized as follows:

menu.add(0,1,1,R.string.kitapliga_ekle)
                    .setIcon(R.drawable.plus_icon)
                    .setShowAsAction(
                            com.actionbarsherlock.view.MenuItem.SHOW_AS_ACTION_ALWAYS |
                            com.actionbarsherlock.view.MenuItem.SHOW_AS_ACTION_WITH_TEXT);

This is how it looks like:

enter image description here

I wonder if I can swap icon and text. also is margin between them possible?

Upvotes: 0

Views: 159

Answers (1)

Yash Sampat
Yash Sampat

Reputation: 30611

I believe it would be easier to create a custom layout in XML for your ActionBar and then set it using ActionBar.setCustomView().

Upvotes: 1

Related Questions