Hello,
I add a android:paddingLeft="20dp"
to <CheckBox>
Then adjust the potions for TextDrawable
like following code.
public class TextDrawable : ShapeDrawable
{
public override void Draw(Canvas canvas)
{
base.Draw(canvas);
Paint textpaint = new Paint() { Color = Application.Context.Resources.GetColor(Resource.Color.Orange, null), TextAlign = Paint.Align.Center, TextSize = 2f * canvas.Height / 3 };
// I donot have this font,so I remove it textpaint.SetTypeface(Application.Context.Resources.GetFont(Resource.Font.arialfamily));
Rect bounds = new Rect();
textpaint.GetTextBounds("?",0, 1, bounds);
canvas.DrawRect(-80, 0, -60, 20, new Paint() { Color = Application.Context.Resources.GetColor(Resource.Color.White, null) });
canvas.DrawText("?", -40 , 20 * Application.Context.Resources.DisplayMetrics.Density / 2f, textpaint);
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.