I'm showing an alert dialog and it looks good out ...
# compose
c
I'm showing an alert dialog and it looks good out of the box when I do this (it has space between the title and text. As expected
Copy code
AlertDialog(
title = {
    Text(text = "Dialog Title")
}, text = {
Text("Here is a text ") },
But once I replace Text("Here is a text ") with TextField then the space goes away. Trying to add a spacer also doesn't work. Really confused. Ideas?
z
They do some custom layout logic in AlertDialog, it has never really worked great for me - but you can easily copy the source code and replace their logic with a column! Let me know if youd like me to share the resulting code!
c
Gotcha. Yeah I guess I just could use a Dialog, but I liked the "standardness" of alert dialog (size, background, rounded corners) and was trying not to reinvent the wheel.
z
Ya, I wish it worked better out of the box too. I think I opened an issue for it back in the day but Im not 100% sure. On a positive note, at least the built in Dialog & Surface composables do all the heavy lifting in terms of size, shape, background, and all that jazz 🙂