I will just post code to you without saying much nonsense. The specific code is as follows:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:andro> <translate android:fromXDelta="0" android:toXDelta="0" android:fromYDelta="120" android:toYDelta="0" android:duration="500" /> </set>
Then define the animation file that disappears:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:andro> <translate android:fromXDelta="0" android:toXDelta="0" android:fromYDelta="0" android:toYDelta="120" android:duration="500" /> </set> PopupWindowThe animation display effect is throughsetAnimationStyle(int id)Method settings,inidFor onestyleofid,So we need to set an animation style in the file: <style name="popwin_anim_style"> <item name="android:windowEnterAnimation">@anim/menushow</item> <item name="android:windowExitAnimation">@anim/menuhide</item> </style>
Then set PopupWindow in the program to:
PopupWindow pop = new PopupWindow(view, .FILL_PARENT, .WRAP_CONTENT); (.popwin_anim_style);
The above is the animation of popupwindow entry and exit in Android introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support for my website!