Wie füge ich Padding zwischen Menüelementen in Android hinzu?
Ich habe Menüpunkte aus res/Menü/menu.xml auf ActionBar aufgeblasen wird, wie füge ich Polsterung zwischen den Menüpunkten mit 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-Datei:
@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;
}
Die wichtige Sache ist "minWidth" es ist 80dp standardmäßig. Das heißt, auch ohne Polsterung kann Platz sein. Das war das Problem in meinem Fall. –
Wie kann ich diesen Stil in meinem Menüpunkt verwenden? Wenn Sie einfachen Code teilen, wird es hilfreich sein Danke –