如何删除Lollipop中的警报对话框行

时间:2016-06-06 13:45:42

标签: android alertdialog android-alertdialog

如何删除棒棒糖中的警告对话框?我只是使用默认的警告对话框代码,它在棒棒糖中工作正常,但有时候对话框会在棒棒糖设备中显示对话框底部的行。

AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
alertDialogBuilder.setTitle("App Name"); 
alertDialogBuilder.setIcon(R.drawable.ic_launcher);                
alertDialogBuilder
        .setMessage("Do you want to close this app?")
        .setCancelable(false)
        .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {

            }
        })
        .setNegativeButton("No", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
                dialog.cancel();
            }
        });
AlertDialog alertDialog = alertDialogBuilder.create();
alertDialog.show();

enter image description here

0 个答案:

没有答案