[英]how to animate activity from center of screen and then spread to full screen
我想从屏幕中央对活动进行动画处理,然后全屏打开。 (就像开花一样)。
我已经尝试过了,但是滑进去了。
开始
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="50%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="0%" />
结束
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="0%"
android:interpolator="@android:anim/accelerate_interpolator"
android:toXDelta="-100%" />
Intent detail = new Intent(this, DetailActivity.class);
startActivity(detail);
overridePendingTransition(R.anim.start,R.anim.end);
通过ICS,您可以根据需要扩展默认的打开动画。 我从ICS资源目录中获得了这些代码。 您可以从平台文件中找到另一个示例(android-sdk-macosx \\ platforms \\ android-15 \\ data \\ res \\ anim \\ activity _ *。xml)
我从activity_open_enter.xml
获得以下代码。
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:zAdjustment="top" >
<alpha
android:duration="@android:integer/config_shortAnimTime"
android:fillAfter="false"
android:fillBefore="false"
android:fillEnabled="true"
android:fromAlpha="0.0"
android:interpolator="@interpolator/decelerate_cubic"
android:toAlpha="1.0" />
<scale
android:duration="@android:integer/config_shortAnimTime"
android:fillAfter="false"
android:fillBefore="false"
android:fillEnabled="true"
android:fromXScale="1.1"
android:fromYScale="1.1"
android:interpolator="@interpolator/decelerate_quint"
android:pivotX="50%p"
android:pivotY="50%p"
android:toXScale="1.0"
android:toYScale="1.0" />
</set>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.