I've been trying to make the ActionBar logo, or the Up button, a text instead of an image. actionbar.setLogo();
accepts only a drawable resource. Inflating a layout with a TextView
didn't do the trick.
Basically, what I'm trying to accomplish is this:
The first one is from the new DeskClock app from Android 4.2 and the second is from the Contacts app. I checked the code in GitHub but I couldn't find anything.
Here is an implementation of @CommonsWare's option #1, works perfectly.
R.layout.up_text
:Off the cuff:
Option #1: Draw your text (
TextView
or directly) on aBitmap
-backedCanvas
, and then supply aBitmapDrawable
tosetLogo()
.Option #2: Hide the icon and logo and use
setCustomView()
to have your caret image and your text.