如果我使用对话框,那么Dialog.getWindow().setLayout(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
但我需要使用DialogFragment。

发布于 2013-12-16 14:03:04
我找到了答案。需要添加到DialogFragment中:
public void onResume(){
super.onResume();
Window window = getDialog().getWindow();
window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
window.setGravity(Gravity.CENTER);
}发布于 2013-12-16 06:07:07
最好使用带有对话框主题的活动。它会处理方向和其他事情。
android:theme="@android:style/Theme.Dialog"只管用
getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);` 在您的onCreate方法中。
https://stackoverflow.com/questions/20604338
复制相似问题