SyntaxFix
Write A Post
Hire A Developer
Questions
Add these to your onDraw method:
paint.setColor(getContext().getResources().getColor(R.color.black)); paint.setTextAlign(Paint.Align.CENTER); canvas.drawText("Text", (float) getHeight() / 2f, (float) getWidth() / 2f, paint);