首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

将字体旋转一上

2012-09-27 
将字体旋转一下今天突然想起这个问题 然后试了一下其实也不难public class UpsideDownText extends TextVi

将字体旋转一下

今天突然想起这个问题 然后试了一下其实也不难

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
?}

}

热点排行