how to add padding between menu items in android?

android, android-actionbar, android-layout

Solution

Found solution, added following lines in styles.xml file and it worked!!

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:actionButtonStyle">@style/MyActionButtonStyle</item>
</style>

<style name="MyActionButtonStyle" parent="AppBaseTheme">
    <item name="android:minWidth">20dip</item>
    <item name="android:padding">0dip</item>
</style>

Problem

I'm having menu items being inflated from res/menu/menu.xml on to ActionBar, how do I add padding between menu items using android? ``` <item android:id="@+id/home" android:showAsAction="always" android:title="Home" android:icon="@drawable/homeb"/> <item android:id="@+id/location" android:showAsAction="always" android:title="Locations" android:icon="@drawable/locationb"/> <item android:id="@+id/preQualify" android:showAsAction="always" android:title="Pre-Qualify" android:icon="@drawable/prequalityb"/> <item android:id="@+id/products" android:showAsAction="always" android:title="Products" android:icon="@drawable/productb"/> ``` Java file: ``` @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_store_locator, menu); return true; } ```

Original source

Related problems