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

android 如何实现汽车仪表盘呢

2012-11-04 
android 怎么实现汽车仪表盘呢如题啊本来是想用rotateanimation做但是它一次动画结束就恢复原样了。。弄了半

android 怎么实现汽车仪表盘呢
如题啊
本来是想用rotateanimation做但是它一次动画结束就恢复原样了。。弄了半天也没找到方法让他不恢复

后来看到用Matrix做
但是呢
Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(), R.drawable.zb);
int width = bitmapOrg.getWidth(); 
int height = bitmapOrg.getHeight(); 

 Matrix matrix = new Matrix();

  this.zc=(ImageView)findViewById( R.id.zc);
   
 matrix.postRotate(i,(float)width/2,(float)height);

  Bitmap resizedBitmap= Bitmap.createBitmap(bitmapOrg,0,0,width, height,matrix,true); 

  BitmapDrawable bmd = new BitmapDrawable(resizedBitmap);
  zc.setImageDrawable(bmd);

首先图变小了。。
而且旋转的效果不对
有没有高手啊,留下联系方式啊QQ?或者邮箱?

[解决办法]
用两张图,一张是表盘,一张是表针。表针除了表针外全部是透明的。然后让表针旋转就行了

热点排行