How to set ActionBar logo to Text (TextView)?

后端 未结 2 1845
余生分开走
余生分开走 2021-01-06 10:12

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 l

2条回答
  •  暖寄归人
    2021-01-06 10:40

    Off the cuff:

    Option #1: Draw your text (TextView or directly) on a Bitmap-backed Canvas, and then supply a BitmapDrawable to setLogo().

    Option #2: Hide the icon and logo and use setCustomView() to have your caret image and your text.

提交回复
热议问题