Reputation: 598
How to rotate control (checkbox) in 180 or 90 degrees ?
Upvotes: 1
Views: 1875
Reputation: 2763
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.
Upvotes: 3