0
AlertDialogにテーマを追加した後、非常に小さくなっています。ダイアログのサイズをデフォルトに変更する方法は?Android AlertDialogサイズテーマ
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
AlertDialogにテーマを追加した後、非常に小さくなっています。ダイアログのサイズをデフォルトに変更する方法は?Android AlertDialogサイズテーマ
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppCompatAlertDialogStyle);
必要なのは、ダイアログを再開することです。
AlertDialog.Builder
にbuild()
メソッドを呼び出した後、あなたが呼び出すことができます。
alertDialog.getWindow().setLayout(600, 400);
600、400はそれの幅と高さです。
それとも、このコードを、次の画面に設定したい場合:
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(d.getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.MATCH_PARENT;
alertDialogd.show();
alertDialog.getWindow().setAttributes(lp);
、これは動作しません! – XxGoliathusxX