Reputation: 24069
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_settings"
android:icon="@drawable/ic_launcher"
android:title="One"
android:orderInCategory="0"
android:showAsAction="ifRoom" >
<menu>
<item android:id="@+id/subItem1"
android:title="sub 1" />
<item android:id="@+id/subItem2"
android:title="sub 2" />
</menu>
</item>
I want an icon and title for one of my menu tabs but only the icon shows up, where am I going wrong?
Upvotes: 0
Views: 1628
Reputation: 26547
You should add withText
:
android:showAsAction="ifRoom|withText"
However, it's only a hint and there's no guarantee that your tab will display the text. It depends on the device screen size.
Upvotes: 2
Reputation: 57702
As far as I know in portrait mode the text will always be hidden.
You might try removing the title of the actionbar and see if this helps.
Try landscape, there you should see icon and text.
Upvotes: 0