1 dialog 对话框出现和消失 使用的方法
<span style="white-space:pre"> </span>final Dialog dialog = new Dialog(this); dialog.show(); Window window = dialog.getWindow(); WindowManager.LayoutParams lp = window.getAttributes(); window.setContentView(R.layout.dialog); lp.windowAnimations = R.style.customstyle; window.setAttributes(lp);styles中
<style name="customstyle">
<item name="@android:windowEnterAnimation">@anim/in</item>
<item name="@android:windowExitAnimation">@anim/out</item>
</style>
2 activity 的跳转的样式更改
<style name="customstyle_activity" parent="android:Theme.NoTitleBar">
<item name="android:windowAnimationStyle">@style/fade</item>
</style>
<style name="fade" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/in</item>
<item name="android:activityOpenExitAnimation">@anim/out</item>
<item name="android:activityCloseEnterAnimation">@anim/in</item>
<item name="android:activityCloseExitAnimation">@anim/out</item>
</style>
主要是记住这六个 属性。。
代码下载
http://download.csdn.net/detail/wanghao200906/8193213
android dialog和activity 改变出现消失的 动画样式
原文地址:http://blog.csdn.net/wanghao200906/article/details/41446893