1.dync_out_to_right

<?xml version="1.0" encoding="utf-8"?><!-- 从屏幕右边偏离2%位置开始进入,到达终点后有超出在返回终点的动态效果 --><translate xmlns:android="http://schemas.android.com/apk/res/android"    android:duration="300"    android:fromXDelta="100%p"    android:toXDelta="0%p" />

2.dync_out_to_left

<?xml version="1.0" encoding="utf-8"?><!-- 从屏幕左边退出,先退后2%p位置,再向左退出 --><set xmlns:android="http://schemas.android.com/apk/res/android"    android:shareInterpolator="false" >    <translate        android:duration="300"        android:fromXDelta="0%p"        android:toXDelta="-100%p" /></set>

3.从写onResume事件,因为我的activity的android:launchMode="singleTop",如果不是这个,可以放到onPause事件中去
@Override
protected void onResume() {
//放到onResume就可以实现android 返回键动画
overridePendingTransition(R.drawable.dync_out_to_right, R.drawable.dync_out_to_left);
super.onResume();
}



更多相关文章

  1. Android与Unity交互调用mUnityPlayer.quit()方法退出返回上一个A
  2. 【OSC手机App技术解析】- Android完全退出程序
  3. android内部外部存储卡路径的获取
  4. android:launchMode="singleTask" 与 onNewIntent(Intent intent
  5. Android(安卓)之 退出的2种方式
  6. android:launchMode="singleTask" 与 onNewIntent(Intent intent
  7. Android动画中Interpolator 加速器的使用
  8. Android(安卓)监听home键(android:launchMode="singleTask" 与 on
  9. android延续按两次返回退出程序(完整代码)

随机推荐

  1. Android数字签名的学习
  2. ApiDemos导入eclipse
  3. Qt on Android(安卓)之设置应用名为中文
  4. Handler消息传送机制
  5. 【Android(安卓)Developers Training】 1
  6. Recovery简介
  7. Material Design
  8. 源码下载:74个Android开发开源项目汇总
  9. 安卓之初
  10. android开发小技巧2(Dx 1 e…