step1: 在res目录下创建anim文件夹,因为我们的animation动画的xml实现都是在anim文件夹下的
step2: 创建载入动画:
<span style="font-size:18px;"><?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <translate<span style="white-space:pre"> <!-- 平移动画 --></span> android:fromYDelta="100%p" android:toYDelta="0" android:duration="500" /> <alpha<span style="white-space:pre"> <!-- 渐变透明度 --></span> android:fromAlpha="0.7" android:toAlpha="1.0" android:duration="300" /> </set></span>
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false"> <translate android:fromYDelta="0" android:toYDelta="100%p" android:duration="3000" /> <alpha android:fromAlpha="1.0" android:toAlpha="0.5" android:duration="2000" /> </set>
step4:创建style:
<span style="font-size:18px;"><style name="animation"> <item name="android:windowEnterAnimation">@anim/enter</item> <item name="android:windowExitAnimation">@anim/out</item> </style></span>
效果图:
因为之前是用GBK编码,现在是UTF-8,懒得换了,就这样了,,,,PopupWindow的子布局是用GridView实现的,具体用法等同ListView
更多的动画就靠大家去随意发挥喽!!!
reference:http://blog.csdn.net/bob1993_dev/article/details/43684209
原文:http://blog.csdn.net/bob1993_dev/article/details/44541231