I am unable to get the icon to show with or without the title text using the AppCompat Toolbar. The title text appears fine, but there is no icon shown at all.
The icon and title text are defined in a menu.xml using the following xml:
<menu xmlns:app="http://ift.tt/GEGVYd"
xmlns:tools="http://ift.tt/LrGmb4"
xmlns:android="http://ift.tt/nIICcg"
tools:context="ui.CreateProfileActivity">
<item
android:id="@+id/create_profile_submit"
android:title="@string/create_profile_submit"
app:icon="@drawable/ic_done_white_24dp"
app:showAsAction="always"/>
</menu>
In my styles.xml I've set the icon color to be white explicitly (the background of the Toolbar is blue):
<item name="actionBarIconColor">#fff</item>
This is the toolbar_actionbar.xml that is used to display the Toolbar:
<android.support.v7.widget.Toolbar
xmlns:android="http://ift.tt/nIICcg"
xmlns:app="http://ift.tt/GEGVYd"
app:theme="@style/ActionBarThemeOverlay"
app:popupTheme="@style/ActionBarPopupThemeOverlay"
android:id="@+id/toolbar_actionbar"
android:background="?attr/colorPrimaryDark"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
When I launch the application in either portrait or landscape, the icon does not appear.
How do I get the Toolbar to either show:
- The icon and text
- Only the icon
No comments:
Post a Comment