android - ActionBarSherlock narrow items in ActionBar are not centered -
i'm using actionbarsherlock library, activity has flag android:uioptions="splitactionbarwhennarrow", actionbar's items in bottom of screen items described in xml file
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_0" android:title="@string/action_0" android:showasaction="always"/> <item android:id="@+id/menu_1" android:title="@string/action_1" android:showasaction="always"/> <item android:id="@+id/menu_2" android:title="@string/action_2" android:showasaction="always"/> </menu>
i'm inflating menu
public boolean oncreateoptionsmenu(menu menu) { menu.clear(); menuinflater supportmenuinflater = getsupportmenuinflater(); supportmenuinflater.inflate(r.menu.inbox_conversation, menu); return super.oncreateoptionsmenu(menu); }
after, on devices android 2.3, menu items not have same weight first 2 options take 80% percents of action bar & latest takes 20%, not aligned & don't take equal space. don't know do. suggestions? many thanks!
might want try adding layout-weight in item tag in xml
<item android:id="@+id/menu_0" android:title="@string/action_0" android:showasaction="always" android:layout_width="wrap_content" android:layout_weight="1" > </item>
Comments
Post a Comment