所以我有这个 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);
}
它的作用是绘制一个正在旋转的箭头,并且文本也在箭头附近旋转我想要的是箭头下方某处的静态文本......或类似的东西。