我试图在下面的代码中画一条线,但我什么也没得到!我错过了什么或可能出了什么问题吗?drawObjects(canvas);
我用betweencanvas = surfaceHolder.lockCanvas();
和surfaceHolder.unlockCanvasAndPost(canvas);
Help 来调用这段代码!
// Method to draw objects
private void drawObjects(Canvas canvas) {
// Clear screen with black color
canvas.drawRGB(0, 0, 0);
// Draw line
if(fingerUp) {
Log.i("Test", "Draw line now!");
path.moveTo(xStart, yStart);
path.lineTo(xEnd, yEnd);
paint.setColor(Color.WHITE);
paint.setStrokeWidth(10);
canvas.drawPath(path, paint);
}
// Call method draw() in CircleManager to draw all circles in list
circleManager.drawCirclesInList(canvas);
}