Icon and Text in Actionbar menu

Asked

Viewed 140 times

0

How can I always display the text icon on a button in Actionbar?

I did so:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/action_confirmar"
        android:title="Confirmar"
        android:icon="@drawable/ic_confirmar"
        app:showAsAction="always|withText" />

</menu>

The problem is, it’s only displaying the text when the screen is in Landscape(lying down). Portrait(standing) has enough space to display the text, only it does not appear.

  • Do you have a specific layout for Landscape? Something like a res/layout-land folder and xml’s inside? If yes, make sure you are not using this menu only in the Landscape layout.

  • I have no menu for Landscape no, I use the same for both Landscape and Portrait.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.