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

COD3BOY
  • 11,964
  • 1
  • 38
  • 56
DJ180
  • 18,724
  • 21
  • 66
  • 117

1 Answers1

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.

hackbod
  • 90,665
  • 16
  • 140
  • 154
  • OK, this makes sense based on all my readings, I will just look to create my own custom layout so – DJ180 Feb 13 '12 at 03:40
  • Here's another thread that might help with creating a custom layout: http://stackoverflow.com/a/9827390/475217 – Ben Jakuben Jun 16 '14 at 16:24