以下是onDraw函数的代码。它绘制圆圈并正常运行,但是当我在LOGCAT中输出圆坐标时,我什么也看不见。我导入了" android.Util.Log"同样, Log.d命令未在Logcat中显示。
@Override
protected void onDraw(Canvas canvas)
{
super.onDraw(canvas);
int pl = getPaddingLeft();
int pr = getPaddingRight();
int pt = getPaddingTop();
int pb = getPaddingBottom();
int usableWidth = w - (pl + pr);
int usableHeight = h - (pt + pb);
int radius = Math.min(usableWidth, usableHeight) / 2;
int cx = pl + (usableWidth / 2);
int cy = pt + (usableHeight / 2);
paint.setColor(circleColor);
//canvas.drawCircle(w, h, (radius * 1.5f), paint);
Log.d("CIRCLE DRAW", "Circle coordinates are as ");// +
//"X: "+ w +
//"Y: "+ h);
}