我尝试了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();
}
}