AlertDialog deformed

1

Well, could anyone tell me why my AlertDialog gets deformed, with that white piece on top of the text?

Here is the code where I created it:

      AlertDialog.Builder builder = new AlertDialog.Builder(ChoseSecundarioDisciplinas.this,android.R.style.Theme_Holo_Light_Dialog_MinWidth);
    builder.setCancelable(true);
    builder.setMessage("Frequenta o 12º ano de ensino?");
    builder.setPositiveButton("Sim",
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog,
                                    int which) {
                    decimoSegundo=true;
                    dialog.dismiss();
                }
            });
    builder.setNegativeButton("Não",
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog,
                                    int which) {
                    disciplinasSecundario.add("Filosofia");
                    decimoSegundo=false;
                    dialog.dismiss();
                }
            });
    AlertDialog alert = builder.create();
    alert.show();
    Button nbutton = alert.getButton(DialogInterface.BUTTON_NEGATIVE);
    nbutton.setTextColor(getResources().getColor(R.color.Cyan));
    Button pbutton = alert.getButton(DialogInterface.BUTTON_POSITIVE);
    pbutton.setTextColor(getResources().getColor(R.color.Cyan));

    
asked by anonymous 25.07.2017 / 19:30

1 answer

2

Remove the title from AlertDialog . See:

alert.requestWindowFeature(Window.FEATURE_NO_TITLE);
    
25.07.2017 / 19:51