由网友(Outlier(局外人))分享简介:默认的动画时,返回按钮是pressed是从左至右滑动。我想替换一个自定义动画。我目前认为的某种组合 onBack pressed()和 overridePendingTransition 会做的伎俩,但我一直没能得到它的工作。The default animation when the Back button is...
默认的动画时,返回
按钮是pressed是从左至右滑动。我想替换一个自定义动画。我目前认为的某种组合 onBack pressed()
和 overridePendingTransition
会做的伎俩,但我一直没能得到它的工作。
The default animation when the Back
button is pressed is a slide from left to right. I'd like to replace that with a custom animation. I'm currently thinking that some combination of onBackPressed()
and overridePendingTransition
will do the trick, but I haven't been able to get it working.
推荐答案
我觉得你不应该使用结束(),因为在浏览存储的数据将被删除
I think you shouldn't use finish() because the data stored by the Views will be erased
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.zoom_enter, R.anim.zoom_exit);
}
相关推荐
最新文章