How to rotate control (checkbox) in 180 or 开发者_如何学JAVA90 degrees ?
One way is roughly the same as in this question:
public class CheckBox90 extends CheckBox {
public CheckBox90(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onDraw(Canvas canvas) {
canvas.rotate(90,20,20);
super.onDraw(canvas);
}
}
...but that's kind of hacky. Probably better to do it this way. Grab the checkbox images, rotate them in the image editor of your choice, then tell Android to use the rotated versions.
精彩评论