I want to stick item at bottom of screen. I did this in larger screen without any problem with the help of this stack overflow. Now I want to stick item in smaller screen, but above stack overflow answer is not working in smaller screen.
@Preview(showBackground = true, widthDp = 240, heightDp = 432)
@Composable
fun PreviewCompose() {
Theme {
Column(
Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.SpaceBetween
) {
Text(
"Parent 1",
modifier = Modifier
.background(Color(0xffF44336)),
color = Color.White,
fontSize = 75.sp
)
Text(
"Parent 2",
modifier = Modifier
.background(Color(0xffF44336)),
color = Color.White,
fontSize = 75.sp
)
Text(
"Parent 3",
modifier = Modifier
.background(Color(0xffF44336)),
color = Color.White,
fontSize = 75.sp
)
Spacer(modifier = Modifier.weight(1f))
Column() {
Text(
"Child 1",
modifier = Modifier
.background(Color(0xffF44336)),
color = Color.White
)
Text(
"Child 2",
modifier = Modifier
.background(Color(0xffF44336)),
color = Color.White
)
}
}
}
}
Actual Output
I am adding my youtube link to understand.
Expected Output