martmists
02/27/2025, 5:53 PMmartmists
02/27/2025, 6:03 PMromainguy
02/27/2025, 6:23 PMmartmists
02/27/2025, 6:47 PMRow(modifier=Modifier.height(120.dp)) {
Column {
Row(Modifier.height(60.dp)) {
// A bunch of elements with .aspectRatio, hence why I need to hardcode a height
}
Row(Modifier.height(60.dp)) {
// Same here
}
}
// some other elements here
}
When this snippet receives a few different values for LocalDensity less than 1, those two rows will not end up having the same width, causing elements in them to be misaligned.Alex Vanyo
02/27/2025, 6:56 PMAlex Vanyo
02/27/2025, 6:59 PMColumn
that contains 6 items that are each 10dp high might end up being 60dp high, or ~61.7dp high, or something else, depending on the densityromainguy
02/27/2025, 7:05 PMmartmists
02/27/2025, 7:23 PMAlex Vanyo
02/27/2025, 8:07 PMmartmists
02/27/2025, 8:38 PMmartmists
02/27/2025, 8:39 PMromainguy
02/27/2025, 8:41 PMromainguy
02/27/2025, 8:41 PMmartmists
02/27/2025, 8:57 PMAlex Vanyo
02/27/2025, 11:28 PMModifier.height(120.dp)
if you don’t need it and let the size be taken up naturally, which should allow each child to get the same rounded heightAlex Vanyo
02/27/2025, 11:31 PMmartmists
02/28/2025, 6:54 AM