How to display Text in Android Canvas ShapeDrawable with in the RectShape or OvalShape?
问题 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 the String on that! public class CustomDrawableView extends View { private ShapeDrawable mDrawable; public CustomDrawableView(Context context) { super(context); int x = 10; int y = 10; int width = 300; int height = 50; mDrawable = new ShapeDrawable(new OvalShape()); mDrawable.getPaint().setColor(0xff74AC23); mDrawable.setBounds(x, y,