0

`

 @Composable fun SearchScreen(navController: NavHostController) { Scaffold( topBar = { SearchBar() }, content = { Column(modifier = Modifier .fillMaxSize() .verticalScroll(rememberScrollState())) { Text(stringResource(id = R.string.genreFilter)) Row( modifier = Modifier .horizontalScroll(rememberScrollState()), horizontalArrangement = Arrangement.spacedBy(4.dp) ) { // some nested Composables } }}, ) } 

But with this code as-is, the whole code within content = {...} is being underlined in red saying Jetpack Compose: Content padding parameter it is not used. I do not understand why I am getting this error.

1 Answer 1

2

It's a lint error warning you about not using PaddingValues coming from content.

@Composable fun Scaffold( modifier: Modifier = Modifier, topBar: @Composable () -> Unit = {}, bottomBar: @Composable () -> Unit = {}, snackbarHost: @Composable () -> Unit = {}, floatingActionButton: @Composable () -> Unit = {}, floatingActionButtonPosition: FabPosition = FabPosition.End, containerColor: Color = MaterialTheme.colorScheme.background, contentColor: Color = contentColorFor(containerColor), contentWindowInsets: WindowInsets = ScaffoldDefaults.contentWindowInsets, content: @Composable (PaddingValues) -> Unit ) 

You can either add it as Modifier.padding(it) to your Column or hover red underlined code and click red light bulb and select suppress

enter image description here

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.