Android: showAsAction = "ifRoom" doesn't work when using ActiobarSherlock
I have the following menu.xml structure:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_button_1"
android:icon="@drawable/menu1"
android:showAsAction="ifRoom"
android:title="@string/s1"/>
<item
android:id="@+id/menu_button_2"
android:icon="@drawable/menu2"
android:showAsAction="ifRoom"
android:title="@string/s1">
</item>
</menu>
@Override
public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
// TODO Auto-generated method stub
com.actionbarsherlock.view.MenuInflater inflater =getSupportMenuInflater();
inflater.inflate(R.menu.main_menu, menu);
return true;
}
If the action bar title is longer, the menu items are not hidden, but the ActionBar text becomes shorter. Instead of this ActionBarTitle I get something like ActionBarT ... I tried adding android: showAsAction = "ifRoom" to the elements, but nothing changes. How do I get the menu symbols to hide if there is no room for the ActioBar title? thank
+3
source to share
No one has answered this question yet
Check out similar questions: