关于 android setAnimationStyle 的问题
很多人反映android setAnimationStyle 无法使用
也就是popupwindow的谈窗
举个例子
代码如下:
pw.setAnimationStyle(R.anim.fadingin);
pw.update();
pw.showAtLocation(findViewById(R.id.txtview), Gravity.BOTTOM, 0,0);
anim/fadingin.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:shareInterpolator="true">
<scale android:fromXScale="0.6" android:toXScale="1.0"
android:fromYScale="0.6" android:toYScale="1.0" android:pivotX="50%"
android:pivotY="50%" android:duration="5000" />
<alpha
android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="5000" />
</set>
有人说这里设置了动画为什么没显示
说要设置 style 我设置找不到动画item
我也找了半天 最后发现
在res/values/style.xml代码:
- <?xml version="1.0" encoding="utf-8"?>
- <resources>
- <mce:style name="PopupAnimation" parent="android:Animation"><!--
- <item name="android:windowEnterAnimation">@anim/popup_enter</item>
- <item name="android:windowExitAnimation">@anim/popup_exit</item>
- --></mce:style><style name="PopupAnimation" parent="android:Animation" mce_bogus="1"> <item name="android:windowEnterAnimation">@anim/popup_enter</item>
- <item name="android:windowExitAnimation">@anim/popup_exit</item>
- </style>
- </resources>