onDraw()中的旋转按钮

时间:2011-05-09 13:53:02

标签: android

我尝试了it this way,但这不起作用。我做错了什么?

    RotateButton sdb = (RotateButton) findViewById(R.id.slideDown);
    sdb.invalidate(); //rotate 

班级:

public class RotateButton extends Button    {

    public RotateButton (Context context) {
        super(context);
    }

    public RotateButton (Context context, AttributeSet set) {
        super(context, set);
    }


    @Override
    protected void onDraw(Canvas canvas) {
        canvas.save();
        Log.d("temp", "rotating");
        canvas.rotate(90);
        super.onDraw(canvas);
        canvas.restore();
        //requestLayout();
    }


}

0 个答案:

没有答案