我正试图将这些项目集中在我的Android应用程序的操作栏中,但我似乎无法这样做。我已经实现了android:layout_gravity="center"
但是项目没有居中,我不确定如何纠正这种行为。
http://i.stack.imgur.com/JOgid.png
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/icon_who_top_center"
android:icon="@drawable/icon_who_top_center"
android:title="@string/icon_who_top_center"
android:layout_gravity="center"
android:showAsAction="always"/>
<item android:id="@+id/icon_vehicles_top_center"
android:icon="@drawable/icon_vehicles_top_center"
android:title="@string/icon_vehicles_top_center"
android:layout_gravity="center"
android:showAsAction="always"/>
<item android:id="@+id/icon_weapons_top_center"
android:icon="@drawable/icon_weapons_top_center"
android:title="@string/icon_weapons_top_center"
android:layout_gravity="center"
android:showAsAction="always"/>
<item android:id="@+id/icon_music_top_center"
android:icon="@drawable/icon_music_top_center"
android:title="@string/icon_music_top_center"
android:layout_gravity="center"
android:showAsAction="always"/>
<item android:id="@+id/icon_syncreel_top_right"
android:icon="@drawable/icon_syncreel_top_right"
android:title="@string/icon_syncreel_top_right"
android:showAsAction="always" />
<item android:id="@+id/icon_list_top_right"
android:icon="@drawable/icon_list_top_right"
android:title="@string/icon_list_top_right"
android:showAsAction="always" />
<item android:id="@+id/icon_share_top_right"
android:icon="@drawable/icon_share_top_right"
android:title="@string/icon_share_top_right"
android:showAsAction="always" />
<item android:id="@+id/icon_statsstar_top_right"
android:icon="@drawable/icon_statsstar_top_right"
android:title="@string/icon_statsstar_top_right"
android:showAsAction="always" />
<item android:id="@+id/icon_settings_top_right"
android:icon="@drawable/icon_settings_top_right"
android:title="@string/icon_settings_top_right"
android:showAsAction="always"/>
</menu>