How to increase Alertdialog text size?

Asked

Viewed 644 times

2

You can increase the font size of a message I display inside a AlertDialog?

Code:

AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);

builder.setMessage("Gasolina");
builder.setTitle("Sua melhor opção é:");
builder.setPositiveButton("OK",null);
builder.show();

1 answer

3


Use this code below to change the text size:

AlertDialog dialog = new AlertDialog.Builder(this)
        .setTitle("Gasolina")
        .setMessage("Sua melhor opção é: ")
        .setPositiveButton("OK", null)
        .show();

        TextView textView = (TextView) dialog.findViewById(android.R.id.message);
        textView.setTextSize(40);
  • added the code to the question

  • Denis, I changed my answer with the correct code for you to use.

Browser other questions tagged

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