0

I have read lots of articles, here and elsewhere about customizing AlertDialogs, and those created by AlertDialog.Builder.

The approach that I'm using at the moment is injecting my AlertDialog.Builder with a ContextThemeWrapper. This ContextThemeWrapper is configured to read from a custom style that inherits from Theme.Dialog.

My customization requirements are quite straightforward:

  1. Change the title bar background colour from the default navy/black version
  2. Change the font type and size of both title and buttons

I've had a look in the default themes.xml and styles.xml but I don't see where to configure number 1 in particular...can someone let me know how this is done?

Also, some of the solutions I've seen involve inflating a layout and then setting this using AlertDialog.Builder.setView()...if I was to customize using this way then how do I design the views for positive and negative buttons?

Thanks

1 Answer 1

2

Sorry, alert dialogs are not really intended to be themed like that. They are basically the most concrete thing you can do -- a canned appearance for standard common situations.

If you want to have a dialog with a customized appearance, you should just start with the Dialog class.

Sign up to request clarification or add additional context in comments.

2 Comments

OK, this makes sense based on all my readings, I will just look to create my own custom layout so
Here's another thread that might help with creating a custom layout: stackoverflow.com/a/9827390/475217

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.