使用Style实现的popwindow弹出和收起的动画效果

在styles中设置actionbar中的下拉菜单弹出和收起的动画

<!--系统级theme下设置 actionbar下拉菜单的弹出动画 -->
<style name="TestTheme" parent="@android:style/Theme.Holo.Light">
        <item name="android:popupAnimationStyle">@style/MyPopupMenuAnimaiton</item>
</style>

<style name="MyPopupMenuAnimaiton" parent="android:Animation">
        <item name="android:windowEnterAnimation">@anim/circles_actionbar_pop</item>
        <item name="android:windowExitAnimation">@anim/circles_actionbar_pop</item>       
</style>


弹出动画:

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

收起动画:

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


你可能感兴趣的:(android,androidbar)