12

Possible Duplicate:
Custom dialog on Android: How can I center its title?

I have code:

     return new AlertDialog.Builder(getActivity())

            .setTitle("Warning!")
            .setMessage("message!")
            .setPositiveButton("yes ",
                new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int whichButton) {

etc... how .setTitle("Warning!") set to the CENTER?

Community
  • 1
  • 1
Mr_redpants
  • 267
  • 2
  • 3
  • 10

1 Answers1

3

You cannot center the title in the default alert dialog.

You will need to create a custom dialog in order to center the title.

The answers here describe how it can be done.

Community
  • 1
  • 1
Mike L.
  • 589
  • 6
  • 16