Neal Sanche
10/24/2019, 4:37 PM@Preview
@Composable
fun MainScreen() {
MaterialTheme {
Row(mainAxisSize = LayoutSize.Expand) {
Greeting("Android")
}
}
}
@Composable
fun Greeting(name: String) {
Card(shape = RoundedCornerShape(4.dp), elevation = 10.dp) {
Text(text = "Yo $name!", style = +themeTextStyle { button })
}
}
and my preview looks like:Neal Sanche
10/24/2019, 4:47 PMLouis Pullen-Freilich [G]
10/24/2019, 4:57 PMGreeting
, Card
will just wrap its child by default - so you want the inside of the Card to be expanded, you can try wrapping the Text in a container and making it expandedLuca Nicoletti
10/24/2019, 5:07 PMwrap
on its contentNeal Sanche
10/24/2019, 5:08 PMexpanded = true
and this expands in height, but the card is only as wide as the text.Luca Nicoletti
10/24/2019, 5:08 PMMihai Hrincescu
10/24/2019, 6:25 PMMihai Hrincescu
10/24/2019, 6:32 PMLuca Nicoletti
10/24/2019, 6:33 PMNeal Sanche
10/24/2019, 6:44 PMcrossAxis*
and mainAxis*
for Column and Row. Now that I know to use Column and not Row for this, I guess I can move forward. Thanks.Mihai Hrincescu
10/24/2019, 6:46 PMFlexRow
like this:Luca Nicoletti
10/24/2019, 6:47 PMFlexRow
and FlexColumn
will soon go away