标签:
AlertDialog.Builder mBuilder = new AlertDialog.Builder(this, R.style.full_screen_dialog);
View view = LayoutInflater.from(this).inflate(R.layout.item_list, null);
mBuilder.setView(view);
Dialog mDialog = mBuilder.create();
Window win = mDialog.getWindow();
//显示对话框时,后面的Activity不变暗,可选操作。
win.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
win.setWindowAnimations(R.style.anim_dialog_bottom);
//获取对话框当前的参数值
WindowManager.LayoutParams params = win.getAttributes();
params.gravity = Gravity.BOTTOM;
win.setAttributes(params);
mDialog.show();
<style name="full_screen_dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
</style>
标签:
原文地址:http://blog.csdn.net/pengkv/article/details/50296545