I come to ask you for help concerning a small problem I can't find the solution. I'm making a small application in Jetpack Compose, and I can't get the TopAppBar to disappear and leave only the part that slides up. This is a screenshot: screenshot
Here is my code:
@Composable
fun Test2() {
val topAppBarElementColor = MaterialTheme.colors.onPrimary
var scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(rememberTopAppBarState())
Scaffold(
topBar = {
LargeTopAppBar(
title = { Text(text = "TopBar") },
navigationIcon = { IconButton(onClick = { /*TODO*/ }) { Icon(imageVector = Icons.Default.Menu, contentDescription = "") } },
scrollBehavior = scrollBehavior
)
},
modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection)
) { innerPadding ->
LazyColumn(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding)
) {
items((1..50).toList()) { item ->
Text(modifier = Modifier.padding(8.dp), text = "Item $item")
}
}
}
}```