HothCoder
HothCoder

Reputation: 55

Android custom Toolbar text button

I'm new and I have created a toolbar for my activity.

Is it possible to set a 'text button' instead of a res Image

I would like to have a clickable thing with 'new track' on it instead of a plus

xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/add"
    android:visible="true"
    android:title="@string/addsome"
    android:icon="@drawable/ic_plus"
    app:showAsAction="always">
</item>

Help would be great

Upvotes: 4

Views: 2542

Answers (2)

Mohit Suthar
Mohit Suthar

Reputation: 9395

Remove android:icon inside item tag, you can use this type of code

 xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/add"
    android:visible="true"
    android:title="@string/addsome"
    app:showAsAction="always">
</item>

Upvotes: 3

Masum
Masum

Reputation: 4969

Just remove this line android:icon="@drawable/ic_plus".

Upvotes: 5

Related Questions