开发者

Android rotate control

开发者 https://www.devze.com 2023-01-03 03:48 出处:网络
How to rotate control (checkbox) in 180 or 开发者_如何学JAVA90 degrees ?One way is roughly the same as in this question:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消