什么是动画ImageView?

时间:2014-11-06 15:04:06

标签: android

我想在主屏幕中执行ImageView(catHead)的动画。我怎样才能做到这一点? 我想改变catHead的图像,就像动画移动角色一样。 请...帮助

public class CatHeadService extends Service{
    private WindowManager windowManager;
    private ImageView catHead;

 public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();


        windowManager = (WindowManager)getSystemService(WINDOW_SERVICE);
        catHead = new ImageView(this);
        catHead.setImageResource(R.drawable.ic_launcher02);


         final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.WRAP_CONTENT,
                WindowManager.LayoutParams.TYPE_PHONE,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                PixelFormat.TRANSLUCENT);

        params.gravity = Gravity.TOP | Gravity.LEFT;
        params.x = 0;
        params.y = 300;

        windowManager.addView(catHead, params);
 }
}

0 个答案:

没有答案