Android L中的AlertDialog溢出

Android L中的AlertDialog溢出,android,overflow,android-alertdialog,Android,Overflow,Android Alertdialog,我已经创建了一个alertDialog。它在Android KK和以前的版本中工作得非常好,但我在Android L中得到了这个显示: 我使用的代码是: AlertDialog.Builder B1 = new AlertDialog.Builder(this); B1.setTitle("Theme");B1.setIcon(R.drawable.ic_launcher); B1.setMessage("Which theme would you like?"

我已经创建了一个alertDialog。它在Android KK和以前的版本中工作得非常好,但我在Android L中得到了这个显示:

我使用的代码是:

        AlertDialog.Builder B1 = new AlertDialog.Builder(this);
        B1.setTitle("Theme");B1.setIcon(R.drawable.ic_launcher); B1.setMessage("Which theme would you like?"); B1.setCancelable(true);
        B1.setPositiveButton("Light", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                themeLight = true;
                setTheme();
                saveSettings();
            }
        });
        B1.setNegativeButton("Dark", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                themeLight = false;
                setTheme();
                saveSettings();
            }
        });

        AlertDialog alert11 = B1.create();
        alert11.show();
我不希望使用自定义布局。关于如何正确显示此内容,您有何想法

谢谢。

我解决了这个问题

根本的问题是我在styles.xml中将android:fitsystemwindows设置为true

将其设置为false可以解决该问题。非常有趣。

我解决了这个问题

根本的问题是我在styles.xml中将android:fitsystemwindows设置为true


将其设置为false可以解决该问题。非常有趣。

我真的必须这样做吗?上面提到的应该是正确的吗?为什么填充物丢失了?你可能是对的。。。我知道如何调整AlertDialog窗口的大小,但如何更改填充?我真的必须这样做吗?上面提到的应该是正确的吗?为什么填充物丢失了?你可能是对的。。。我知道如何调整AlertDialog窗口的大小,但如何更改填充?