Animation 动画效果在锁定的屏幕上不起作用
我正在尝试给对话框提供简单的动画效果。在这里,我将动画主题设置为对话框,以了解动画如何进入和退出。此代码在解锁设备上正常工作,但在锁定设备上,当对话框出现时,我单击“取消”按钮,对话框消失并显示“锁定屏幕”,但当我尝试在单击按钮后立即解锁屏幕时,我看到对话框以该动画效果退出。但这个效果会转到背景,我想在锁定的屏幕上显示动画效果。同样的代码也适用于平板电脑,但当我尝试在手机上使用时,它会让我出现这种异常行为Animation 动画效果在锁定的屏幕上不起作用,animation,screen,effect,screen-lock,Animation,Screen,Effect,Screen Lock,我正在尝试给对话框提供简单的动画效果。在这里,我将动画主题设置为对话框,以了解动画如何进入和退出。此代码在解锁设备上正常工作,但在锁定设备上,当对话框出现时,我单击“取消”按钮,对话框消失并显示“锁定屏幕”,但当我尝试在单击按钮后立即解锁屏幕时,我看到对话框以该动画效果退出。但这个效果会转到背景,我想在锁定的屏幕上显示动画效果。同样的代码也适用于平板电脑,但当我尝试在手机上使用时,它会让我出现这种异常行为 this is zoom_out_exit.xml file. <?x
this is zoom_out_exit.xml file.
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator"
android:zAdjustment="top" >
<translate
android:duration="5000"
android:fromYDelta="0%p"
android:toYDelta="50%p" />
</set>
this is style.xml file
<style name="AnimationTheme" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="android:windowAnimationStyle">@style/DialogAnimation</item>
</style>
<style name="DialogAnimation" >
<item name="android:windowEnterAnimation">@anim/zoom_in_enter</item>
<item name="android:windowExitAnimation">@anim/zoom_out_exit</item>
</style>
and this theme of animationtheme is set to dialog.
class MyDialog extends Dialog {
MyDialog(Context context) {
super(context, R.style.AnimationTheme);
}
}
can anybody solve my problem ? thanks in advance.
这是zoom\u out\u exit.xml文件。
这是style.xml文件
@样式/对话框动画
@动画/缩放输入
@动画/缩小/退出
animationtheme的这个主题被设置为dialog。
类MyDialog扩展对话框{
MyDialog(上下文){
超级(上下文,R.style.AnimationTheme);
}
}
有人能解决我的问题吗?提前谢谢。
您找到解决方案了吗?我也面临同样的问题