今天突然想起这个问题 然后试了一下其实也不难
public class UpsideDownText extends TextView {
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
canvas.save();
float py = this.getHeight()/2.0f;
float px = this.getWidth()/2.0f;
canvas.rotate(180, px, py);
super.onDraw(canvas);
canvas.restore();
}
public UpsideDownText(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
}
public UpsideDownText(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
public UpsideDownText(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
}