For some reason the four images I put in a row do ...
# compose
m
For some reason the four images I put in a row do not fill the whole available width. Does anyone know why this is happening?
Copy code
Row(Modifier.fillMaxSize().background(Color.Yellow)) {
    val pics = listOf(R.drawable.professor, R.drawable.woman,
    R.drawable.daughter, R.drawable.son)
    for (pic in pics)
        Image(painterResource(id = pic), null, Modifier.fillMaxWidth(0.25f).align(Alignment.Bottom))
}
How can I evenly distribue the width between the pictures? Also, Compose seems to automatically scale down the images as I proceed in the for loop.
a
Modifier.fillMaxWidth()
is relative to the current available width, which means the widths of your images are 0.25, 0.1875 and so on. You should use
Modifier.weight(1f)
here.
🙏 1