首页 > 代码库 > android启动和推出实现侧滑效果

android启动和推出实现侧滑效果

启动:

startActivity(intent);			overridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out);


退出:

 

@Override	public void finish() {		// TODO Auto-generated method stub		super.finish();		overridePendingTransition(R.anim.tran_next_in, R.anim.tran_next_out);	}


对应的xml文件:

tran_next_in.xml

<?xml version="1.0" encoding="utf-8"?><translate    xmlns:android="http://schemas.android.com/apk/res/android"    android:fromXDelta="100%p"    android:toXDelta="0"    android:fromYDelta="0"    android:toYDelta="0"    android:duration="300"    ></translate>


tran_next_out.xml

<?xml version="1.0" encoding="utf-8"?><translate    xmlns:android="http://schemas.android.com/apk/res/android"    android:fromXDelta="0"    android:toXDelta="-100%p"    android:fromYDelta="0"    android:toYDelta="0"    android:duration="300"    ></translate>

android启动和推出实现侧滑效果