0
회전, 크기 조절 및 변형을 적용한 후에 캔바스와 일치하도록 내 뷰의 경계를 업데이트하는 방법을 파악하려고합니다.캔버스 변환 후 뷰 경계 업데이트 (회전, 크기 조절, 변형)
이것은 맞춤 텍스트 뷰용 클래스입니다. 내가 원하는대로 회전하지만 뷰가 내 캔버스 주위를 감싸고 있지 않습니다.
public class RDTextView extends TextView {
public int angle = 0;
public RDTextView(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas)
{ // Save the current matrix
canvas.save();
// Rotate this View at its center
canvas.rotate(angle,this.getWidth()/2, this.getHeight()/2);
// Draw it --- will add scale
super.onDraw(canvas);
// Restore to the previous matrix
canvas.restore();
}
제 관심사는보기 주위에 테두리가 있지만 각도를 변경하면 캔버스 모양을 따르지 않습니다.
경계는 회전 후 변경되지 않습니다하지만 난 내용을 일치하도록 업데이트하고 싶습니다.