以下のような 'drawable' ディレクトリのアクション バーに表示するアイコンごとに xml ファイルを作成します。
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/menuitem_bk"/>
<item android:drawable="@drawable/icon_one"/>
</layer-list>
Drawable icon_one は透明な背景を持つ単なるアイコンであり、'menuitem_bk' は次のように定義された drawable になります。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<size
android:height="36dp"
android:width="36dp" />
<solid android:color="@color/action_bar_items_bk_color" />
</shape>
これらを 4 つ、各ドローアブル ディレクトリ (xhdpi、hdpi、mdpi、および ldpi) に 1 つずつ作成する必要があります。形状のサイズは、ディレクトリによって異なります。
- xhdpi -> 48x48 hdpi -> 36x36 mdpi -> 24x24 ldpi -> 18x18
(これによると: http://developer.android.com/guide/practices/ui_guidelines/icon_design_action_bar.html )
そして、背景付きの ActionBar アイコンを取得しました。