Android Java
[Android] - 안드로이드 화면 전환 슬라이드, Activity Slide
Vivara
2013. 9. 11. 16:07
반응형
왼쪽에서 오른쪽으로 움직일때
startActivity(intent);
overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
오른쪽에서 왼쪽으로 움직일때
overridePendingTransition(R.anim.left_in, R.anim.left_out);
res 폴더 아래 anim 폴더 생성후
left_in.xml
left_out.xml
*. left_in.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="300"/>
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />
</set>
*. left_out.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p" android:duration="300"/>
<alpha android:fromAlpha="1.0" android:toAlpha="0.0" android:duration="300" />
</set>
반응형