Deformed alertdialog

Asked

Viewed 39 times

1

Good, could someone tell me why my Alertdialog is deformed , with that white piece on top of the text ?

Here’s the code I create it in :

      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));

[2]: https://i.stack.imgur.com/2VNXB.png

1 answer

2


Remove the title of AlertDialog. Behold:

alert.requestWindowFeature(Window.FEATURE_NO_TITLE);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.