Kazemihabib1996
05/12/2020, 3:26 PMsize
modifiers:
backgroundColor not works in below code:
Box(backgroundColor = Color.Blue, modifier = Modifier.width(200.dp).height(100.dp))
works in below one:
Box(backgroundColor = Color.Blue, modifier = Modifier.size(200.dp))
Mihai Popa
05/12/2020, 3:41 PMwidth
and height
have been buggy in dev09 and dev10. Please use preferredWidth
or preferredHeight
instead, and switch back to them in dev11 where the bug should be fixedKazemihabib1996
05/12/2020, 3:47 PMMihai Popa
05/12/2020, 3:55 PMwidth
will be respected even when it does not respect the incoming constraints, while preferredWidth
will be coerced inside the incoming constraintsMihai Popa
05/12/2020, 3:56 PMwidth
is not respecting the incoming constraints, the layout will be centered horizontally in the available space