Are you talking about a FloatingActionButton
, I guess?
It subclasses from ImageButton
, so was not likely designed with text in mind, but rather, an image. An ImageButton
in turn is also an ImageView
.
Other Peoples' Solutions
So, you could look up how people have gone about adding text on top of those more common elements. Here are just a few topics on this very site, that came up quickly:
My Ideas
One of several approaches that come to mind would be to implement the FloatingActionButton
's onDraw(Canvas canvas)
method, and then call drawText()
on the Canvas object it receives.
Another idea is to arrange to have a TextView
shown on top of the FloatingActionButton
.
Or, alternately, don't use FloatingActionButton
, but something that more readily accepts text.