标签:
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="500" android:fromXDelta="0" android:fromYDelta="1000" android:toXDelta="0" android:toYDelta="0" /> </set>
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="500" android:fromXDelta="0" android:fromYDelta="0" android:toXDelta="0" android:toYDelta="1000" /> </set>
<style name="main_menu_animstyle"> <item name="android:windowEnterAnimation">@anim/settingswindow_in_anim</item> <item name="android:windowExitAnimation">@anim/settingswindow_out_anim</item> </style>
Window window = dialog.getWindow(); //设置显示动画 window.setWindowAnimations(R.style.main_menu_animstyle); WindowManager.LayoutParams wl = window.getAttributes(); wl.x = 0; wl.y = getWindowManager().getDefaultDisplay().getHeight(); //设置显示位置 dialog.onWindowAttributesChanged(wl);//设置点击外围解散 dialog.setCanceledOnTouchOutside(true); dialog.show();
可以参考github:https://github.com/pinguo-yuyidong/Study_Demos/tree/master/BottomMenu
标签:
原文地址:http://www.cnblogs.com/yydcdut/p/4290867.html