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

Vivek Modi

07/16/2022, 7:35 PM
Hey guys, I started jetpack compose I am getting confused in width and height. In xml we use WRAP_CONTENT/MATCH_PARENT so what we use in compose?
a

andrew

07/16/2022, 7:37 PM
Copy code
- Modifier.size(w, h)
- Modifier.size(size)

- Modifier.width(w).height(h)

- Modifier.fillMaxWidth(weight = 1F)
- Modifier.fillMaxHeight(weight = 1F)
- Modifier.fillMaxSize(weight = 1F)
For some of the basics
The canonical layouts:
Row
,
Column
,
Box
should all shrink to fit
v

Vivek Modi

07/16/2022, 7:41 PM
great thanks a million
a

andrew

07/16/2022, 7:42 PM
The docs are very descriptive as to what each does: https://developer.android.com/jetpack/compose/modifiers-list#Size
👍 1
6 Views