0

I am using the Material 3 Scaffold with the material 3 TopAppBar. I need to change the height of TopAppBar but cannot use MediumTopAppBar as it's too heightened. Is there any way to do the same? Here is the code

val scrollBehaviour = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
Scaffold(
    modifier = Modifier.fillMaxSize(),
    topBar = {
        TopAppBar(
            title = {
                Text(
                    text = "About",
                    modifier = Modifier
                        .padding(start = 30.dp, bottom = 12.dp)
                        .wrapContentSize(),
                    color = colorResource(id = R.color.black)
                )
            },
            colors = TopAppBarDefaults.smallTopAppBarColors(
                containerColor = Color.Red,
                titleContentColor = Color.Black,
            ),
            modifier = Modifier.fillMaxWidth(),
            navigationIcon = {
                Button(onClick = { }) {
                    Text(text = "B1")
                }
            }, actions = {
                Button(onClick = {}) {
                    Text(text = "B2")
                }
            },
            scrollBehavior = scrollBehaviour
        )
    },
    content = {

    }
)
Nik
  • 2,913
  • 7
  • 40
  • 66

0 Answers0