DecorView无法执行动画吗

来源:互联网 发布:windows date 格式 编辑:程序博客网 时间:2024/06/07 15:36
ViewGroup rootView = (ViewGroup) this.getWindow().getDecorView();
TranslateAnimation animation = new TranslateAnimation(
0, 300, 0, 0);
animation.setDuration(3000);
animation.setAnimationListener(new AnimationListener() {

@Override
public void onAnimationStart(Animation animation) {
Log.i("zt", "onAnimationStart");
}

@Override
public void onAnimationRepeat(Animation animation) {
Log.i("zt", "onAnimationRepeat");
}

@Override
public void onAnimationEnd(Animation animation) {
Log.i("zt", "onAnimationEnd");
}
});
rootView.startAnimation(animation);
0 0
原创粉丝点击