Andrew
Andrew

Reputation: 37969

Icon of the menu item doesn't show up in the Action Bar if it is from app drawable folders

When I do like this it works:

    <item
    android:id="@+id/menu_show_location"
    android:title="@string/menu_show_location"
    android:icon="@android:drawable/ic_dialog_map"
    app:showAsAction="always"/>

But if I take icon from app drawable:

    <item
    android:id="@+id/menu_show_location"
    android:title="@string/menu_show_location"
    android:icon="@drawable/ic_action_place"
    app:showAsAction="ifRoom"/>

the menu item doesn't show up nor in the menu nor in the action bar either.

Full xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

    <item android:id="@+id/action_settings"
    android:title="@string/action_settings"
    android:orderInCategory="100"
    app:showAsAction="never" />

    <item
    android:id="@+id/menu_show_location"
    android:title="@string/menu_show_location"
    android:icon="@android:drawable/ic_dialog_map"
    app:showAsAction="always"/>
    <!--android:icon="@drawable/ic_action_place"-->
</menu>

What can be a problem?

Upvotes: 0

Views: 1246

Answers (2)

Andrew
Andrew

Reputation: 37969

In situations like that changing icon color or app theme may helps ))

Upvotes: 0

codePG
codePG

Reputation: 1744

Try this,

<item
    android:id="@+id/menu_show_location"
    android:title="@string/menu_show_location"

    <!--android:icon="@android:drawable/ic_dialog_map"-->

    <!-- need to add an order-->
    android:orderInCategory="200"
    android:icon="@drawable/ic_action_place"
    app:showAsAction="always"/>

Upvotes: 1

Related Questions