Computer scienceMobileJetpack ComposeComposablesFoundation

Spacer and Padding

Different paddings

Report a typo

Finish the DifferentPaddings composable function by adding the right modifiers and parameters to get the result shown below:

Preview of `DifferentPaddings`

Fill in the gaps with the relevant elements
@Composable
fun DifferentPaddings() {
    Column {
        Text("Hello",
            Modifier.( = 8.dp)
        )

        Box(
            Modifier
                .( = 8.dp)
                .size(64.dp)
                .background(Color.Yellow)
        ) { /*...*/ }

        Text("padding",
            Modifier.( = (-32).dp)
        )
    }
}
verticalpaddingFromBaselineoffsettoppaddingy

Create a free account to access the full topic