我有自定义布局,我这样扭曲:
@Override
protected void onDraw(Canvas canvas) {
canvas.skew(0f, 0.2f);
super.onDraw(canvas);
}
虽然,我想从另一边歪斜它(我想要高于左边)所以我决定像这样水平翻转它
@Override
protected void onDraw(Canvas canvas) {
canvas.scale(-1f, 1f, super.getWidth() * 0.5f, super.getHeight() * 0.5f);
canvas.skew(0f, 0.2f);
super.onDraw(canvas);
}
但是按钮,如下所示,翻转也是如此。你能建议我如何只翻转布局,而不是里面的孩子?