android-compose-layout
Jetpack Compose – Centering Text
To define how to align the text horizontally you can apply textAlign = TextAlign.Center in the Text: Column(modifier = Modifier .padding(30.dp) .fillMaxWidth() .wrapContentSize(Alignment.Center) .clickable(onClick = { } ) /*question = “3 Bananas required”*/ .clip(shape = RoundedCornerShape(16.dp)), ) { Box(modifier = Modifier .preferredSize(350.dp) .border(width = 4.dp, color = Gray, shape = RoundedCornerShape(16.dp)), alignment = Alignment.Center ) … Read more
Weights in Jetpack compose
You can use the Modifier.weight Something like: Row() { Column( Modifier.weight(1f).background(Blue) ){ Text(text = “Weight = 1”, color = Color.White) } Column( Modifier.weight(2f).background(Yellow) ) { Text(text = “Weight = 2”) } }