开发者

Android rotate control

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜