I want to create a rotated be X degrees title in android.
Something like that:
I have tried this class
public class AngledTextView extends Button {
public AngledTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onDraw(Canvas canvas) {
// Save the current matrix
canvas.save();
// Rotate this View at its center
canvas.rotate(-45, this.getWidth() / 2, this.getHeight() / 2);
// Draw it
super.onDraw(canvas);
// Restore to the previous matrix
canvas.restore();
}
}
in this layout:
but got chopped text.
How can i fix this?