How to display Text in Android Canvas ShapeDrawable with in the RectShape or OvalShape?

前端 未结 1 1023
予麋鹿
予麋鹿 2020-12-02 01:30

I\'m trying to display Text in RectShape which uses ShapeDrawable to display in Canvas.

I\'m able to display RectShape in this code, but looking for how to display t

相关标签:
1条回答
  • 2020-12-02 01:53

    The best option for me is to create a custom TextDrawable that handles properly how to display a piece of text. Then in your CustomDrawableView in your onDraw(Canvas c) method you can call it to display the text and the oval.

    Take a look at this answer I wrote recently as it contains how to do it properly.

    0 讨论(0)
提交回复
热议问题