I am having some problems showing icons in the toolbar on Android It shows the string, but not the icon.
XML:
<item android:id="@+id/bno_bookmark"
android:visible="true"
android:title="@string/disable_draw"
android:icon="@drawable/ic_pen"
android:showAsAction="always">
</item>
you need to add this to your menu xml
xmlns:app="http://schemas.android.com/apk/res-auto"
then android:showAsAction="always"
should look like this
app:showAsAction="always"
final output would be something like this
<?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/bno_bookmark"
android:visible="true"
android:title="@string/disable_draw"
android:icon="@drawable/ic_pen"
app:showAsAction="always">
</item>
</menu>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With