sweet-alert-dialog
sweet-alert-dialog copied to clipboard
Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:null
new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE) .setTitleText("Are you sure?") .setContentText("Won't be able to recover this file!") .setConfirmText("Yes,delete it!") .show(); 初始化时候报错
you should add an animation file to anim folder of res and use below code:
error_frame_in.xml:
<set xmlns:android="http://schemas.android.com/apk/res/android" xmlns:sweet="http://schemas.android.com/apk/res-auto" android:interpolator="@android:anim/linear_interpolator" android:shareInterpolator="true">
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="400"/>
you should add an animation file to anim folder of res and use below code:
error_frame_in.xml:
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="400"/>
This is working well in Android Studio 4.1 Canary
Just add error_frame_in.xml inside anim as @miladblg suggested
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha
android:fromAlpha="0"
android:toAlpha="1"
android:duration="400"/>
</set>
I'm seeing this error again in Android Studio 4.1.3, with an error of:
Element sweet:cn.pedant.SweetAlert.Rotate3dAnimation is not allowed here
And the crash resolves as:
Unknown animation name: cn.pedant.SweetAlert.Rotate3dAnimation error:cn.pedant.SweetAlert.Rotate3dAnimation
