https://kotlinlang.org logo
#compose
Title
# compose
t

Timo Drick

02/25/2021, 5:07 PM
I do have a problem with Alignment.Bottom in AlertDialog:
Copy code
AlertDialog(
        onDismissRequest = { onAction(DismissDialog) },
        text = {
        Column {
            Row(verticalAlignment = Alignment.Bottom) {
                Text(text = description, Modifier.weight(2f))
                Image(
                    modifier = Modifier.weight(1f).padding(end = 4.dp),
                    painter = painterResource(id = R.drawable.ic_mango_shake),
                    contentDescription = "mango shake",
                    contentScale = ContentScale.Inside
                )
            }
        }
    },...
When i remove the verticalAlignment = Alignment.Bottom i get the expected result:
Btw. this problem exists only in an AlertDialog not in regular screen layouts.
s

Se7eN

02/25/2021, 5:15 PM
The first one looks better imo
t

Timo Drick

02/25/2021, 5:17 PM
Yes that is what i want. But it is cut 😞
s

Se7eN

02/25/2021, 5:19 PM
Maybe make your image smaller
t

Timo Drick

02/25/2021, 5:22 PM
The bottom alignment is than useless because it only works when the text is heigher than the image. And also i want the design to be smart. So it will adapt to different screen sizes.
Maybe i need to report a bug. But i am not sure. Maybe i am doing s.th. wrong.
s

Se7eN

02/25/2021, 5:37 PM
I've had similar problems with
AlertDialog
too. I guess it's worth filing a bug
k

Klaas Kabini

02/25/2021, 5:47 PM
🤣🤣 the message on the dialog kills me with laughter.
2 Views