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?
You cannot center the title in the default alert dialog. You will need to create a custom dialog in order to center the title.
AlertDialog. A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
AlertDialog is a lightweight version of a Dialog. This is supposed to deal with INFORMATIVE matters only, That's the reason why complex interactions with the user are limited. Dialog on the other hand is able to do even more complex things .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With