1

This is menu I've created:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="ninja.majewski.timetableapp.MainActivity">

    <item
        android:id="@+id/action_home"
        android:icon="@drawable/home_icon"
        android:orderInCategory="100"
        android:title="Home"
        app:showAsAction="ifRoom" />

    <item
        android:id="@+id/action_add"
        android:icon="@drawable/add_class_icon"
        android:orderInCategory="100"
        android:title="Add"
        app:showAsAction="ifRoom" />

    <item
        android:id="@+id/action_settings"
        android:icon="@drawable/settings_icon"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="ifRoom" />

</menu>

And this is how it looks like in the emuator which is wrong because title does not fit in the toolbar:

enter image description here

Wchen I launch the app on my phone it appears to work right:

enter image description here

But when I change the title it appears wrong:

enter image description here

My problem is that icons are not showing on the last screen and they appear on the first screen while they should be hidden.

How can I fix that?

Krzysztof Majewski
  • 2,494
  • 4
  • 27
  • 51

0 Answers0