我需要在 ImageView 中间绘制一个矩形来创建一个 CostumeCheckBox。我是 Android 新手,我不知道要这样做。ImageView/CostumeCheckbox 有一个边框:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Rect rect = new Rect();
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(CheckboxBorderColor);
paint.setStrokeWidth(borderWidth);
getLocalVisibleRect(rect);
canvas.drawRect(rect, paint); }