Activity切换动画无效(android:windowIsTranslucent)影响(android:windowAnimationStyle)

来源:互联网 发布:软件系统结构图阶段 编辑:程序博客网 时间:2024/04/27 22:24

原因有两个:

1.style里面设置了android:windowIsTranslucent这个属性

2.windowAnimationStyle需要继承Animation.Translucent


<style name="AppTranslateTheme" parent="AppBaseTheme">        <!-- All customizations that are NOT specific to a particular API-level can go here. -->        <item name="android:windowNoTitle">true</item>        <item name="android:windowIsTranslucent">true</item>        <item name="android:windowBackground">@android:color/transparent</item>        <item name="android:windowAnimationStyle">@style/animation_translucent_translate</item>           </style>


<style name="animation_translucent_translate" parent="@android:style/Animation.Translucent">          <item name="android:windowEnterAnimation">@anim/activity_open_in_anim</item>          <item name="android:windowExitAnimation">@anim/activity_open_out_anim</item>      </style>


0 0