this 토론 그룹의 게시물에 안드로이드 플랫폼 개발자 다이앤 Hackborn에 따르면 this one
참조하십시오, 대화 상자는 WRAP_CONTENT 자신의 윈도우의 최상위 레이아웃 폭과 높이를 설정합니다. 대화 상자를 더 크게 만들려면 해당 매개 변수를 FILL_PARENT로 설정할 수 있습니다.
데모 코드 : 속성이 대화 후 설정되어 있는지
가
AlertDialog.Builder adb = new AlertDialog.Builder(this);
Dialog d = adb.setView(new View(this)).create();
// (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.)
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(d.getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
d.show();
d.getWindow().setAttributes(lp);
참고가 표시됩니다. 시스템은 설정 될 때 까다 롭습니다. (레이아웃 엔진은 대화 상자가 처음 표시 될 때나 레이아웃 엔진을 설정해야한다고 생각합니다.)
Theme.Dialog를 확장하여이를 수행하는 것이 더 좋을 것입니다. 추측 게임을하지 않아도됩니다. setAttributes를 호출 할시기. (대화 상자에 적절한 밝거나 어두운 테마 또는 Honeycomb Holo 테마를 자동으로 적용하려면 약간 더 많은 작업이 필요하지만 http://developer.android.com/guide/topics/ui/themes.html#SelectATheme에 따라 수행 할 수 있습니다.