0

This is my compose app.

Scaffold( // main content
    modifier = Modifier.fillMaxSize(),
    scaffoldState = scaffoldState
) {
    Surface(
        modifier = Modifier
            .fillMaxSize()
            .padding(it),
        color = MaterialTheme.colors.background
    ) {
        NavGraph(navController)
    }
}
// my main screen
Column(
    Modifier.fillMaxSize()
) {
    Column(modifier = Modifier.weight(1f)) {
        HeaderView()
        // other element
    }
    Spacer(modifier = Modifier.height(Padding16))
    ButtonPrimary(
        modifier = Modifier.padding(horizontal = Padding24),
        text = stringResource(id = R.string.accept_and_continue),
        onClick = {
            onContinueClick()
        })
    Spacer(modifier = Modifier.height(Padding16))
}

For most of the devices, the code above was working fine. However, when I tested on a Samsung 21, and Android 12, the bottom button was cut off as below image. Does anyone know the cause and how to solve it?

Button cut off

1
  • Your code you posted is not complete where is the code of bottom pink bar? Commented Sep 9, 2022 at 10:47

1 Answer 1

6

Seems like your app is under the navigation bar. Try adding a .navigationBarsPadding() modifier to your screen's Column

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.