开发者

Can't get to work alpha animation parallel with others

I want to animate my popup window to grow and fade in fluently, but I can't make alpha animation working.

Here is my code:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_decelerate_interpolator">
<alpha
    android:fromAlpha="0.0" android:toAlpha="1.0"
    android:duration="400"
    android:fillAfter="false"
/>
<scale
    android:fromXScale="0.3" android:toXScale="1.0"
    android:fromYScale="0.3" android:toYScale="1.0"
    android:pivotX="50%" android:pivotY="100%"
    android:duration="400"
/>
</set>

In this code only scale animation plays. If I lengthen a开发者_如何转开发lpha duration it shows after scale animation. How to make this animations work together?

This is how I assign the animation to an object:

window.setAnimationStyle(R.style.Animations_PopUpMenu);

Where window is of type PopupWindow

And resource:

<resources>
<style name="Animations.PopUpMenu">
    <item name="@android:windowEnterAnimation">@anim/show</item>
    <item name="@android:windowExitAnimation">@anim/disappear</item>
</style>
</resources>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜