0
所以我有这个函数OnDraw绘制静态文本在旋转画布
protected void onDraw(Canvas canvas) {
Paint paint = mPaint;
canvas.drawColor(Color.WHITE);
paint.setAntiAlias(true);
paint.setColor(Color.BLACK);
paint.setStyle(Paint.Style.FILL);
int w = canvas.getWidth();
int h = canvas.getHeight();
int cx = w/2;
int cy = h/2;
canvas.translate(cx, cy);
if (mValues != null) {
canvas.rotate(-mValues[0]);
}
canvas.drawPath(mPath, mPaint);
Paint paint1 = new Paint();
paint1.setColor(Color.BLACK);
paint1.setTextSize(25);
canvas.drawText("Some Text", 10, 25, paint1);
}
而且它做什么,它吸引的是旋转和文本也旋转箭头接近我想要的是一个静态文本箭头箭头下的某处......或类似的东西。
我想通了!你必须做一个canvas.save();在旋转canvas和canvas.restore()之前;在使用画布绘制文本将是静态之前! – exilonX 2012-08-08 00:03:37