I was trying Jetpack Compose on Android Studio Canary 1 and I added Column composable to the ui. Column has one property called modifier in which we can pass different modifiers. I used Expanded modifier which resulted in Column taking all the available space.
Also, Column has mainAxisSize and crossAxisSize properties so I tried them also and set it to LayoutSize.Expand which is intended to expand the given axis I think. This also resulted in Column taking all the available space. Check out the example below:
1. Using LayoutSize.Expand
Column(mainAxisSize = LayoutSize.Expand,
crossAxisSize = LayoutSize.Expand) {
Text("Jetpack",modifier = ExpandedHeight)
Text("Compose",modifier = ExpandedHeight)
}
Output:
2. Using Expanded
Column(modifier = Expanded) {
Text("Jetpack",modifier = ExpandedHeight)
Text("Compose",modifier = ExpandedHeight)
}
Output:
Observation is that Both the following code provides the same output. Then what is the difference between
ExpandedandLayoutSize.Expandwhen it comes toColumnandRow?

