2

I am relatively new to Android development. Using a number of answers here and articles elsewhere, I added an AlertDialog to my app with setSingleChoiceItems. I am displaying my items and I can get the user's item selection and button choice.

The default text size was too big for me and I was able to use the answer from: Reducing font size of AlertDialog.Builder's components to reduce the text size of my items.

The problem is that the item row height is the same as with the default text size.

My question is how can I also reduce the height of the item rows in my dialog?

I have looked for answers and tried adding "android:layout_height" and "android:minHeight" to my custom dialog theme style.xml but neither had any affect.

My dialog with default settings is

enter image description here

And my dialog with my ContextThemeWrapper is:

enter image description here

Thank you for your help!

Community
  • 1
  • 1
jeff99
  • 21
  • 3

1 Answers1

0

Those RadioButtons probably have default padding or margins. Try setting their padding to 0 and see if that allows the list items to have less height.

David C Adams
  • 1,953
  • 12
  • 12
  • Thanks, David. I can't find the particular style for the radio button padding. Do you know what it is? By the way, I tried to set `listPreferredItemHeight` to 32dip (the default seems to be 64dip) but that didn't make a difference. – jeff99 Feb 09 '14 at 00:16
  • RadioButton is a subclass of View so you can set android:padding, android:paddingBottom, android:paddingEnd, android:paddingLeft, android:paddingRight, android:paddingStart, or android:paddingTop . – David C Adams Feb 09 '14 at 00:22