I have a columns with 3 items in, a button that stick at the top, a LazyColumn for scrolling item, a...
g
I have a columns with 3 items in, a button that stick at the top, a LazyColumn for scrolling item, and another button that I want to stick to the bottom, how can I stick the button to the bottom if the scrollable column only has a couple if items in?
Copy code
Column(
                modifier = Modifier.fillMaxHeight()
            ) {
                Button(
                    onClick = { addPlayer("Player #${players.size}") },
                    enabled = canAddPlayers,
                    modifier = Modifier
                        .padding(8.dp)
                        .fillMaxWidth()
                ) {
                    Text(
                        text = "Add new player (${players.size}/5)",
                    )
                }
                LazyColumn(
                    contentPadding = PaddingValues(5.dp),
                ) {
                    items(players) {
                        PlayerDisplay(
                            player = it,
                            buttons = buttons
                        )
                    }
                }
                Button(
                    onClick = saveAndContinue,
                    enabled = canContinue,
                    modifier = Modifier
                        .padding(8.dp)
                        .fillMaxWidth()
                ) {
                    Text(
                        text = "Save & Play!",
                    )
                }
            }
a
Use Modifier.weight(1f) for the LazyColumn
🙌 1
g
Perfect! Thanks!