https://kotlinlang.org logo
#compose
Title
# compose
m

Marko Gajić

02/05/2023, 5:39 PM
Quick question, I have a problem with Scaffold not updating innerPadding as a result of me showing/hiding a topBar, so is this is a bug I should report or am I missing something?
Copy code
Scaffold(
    topBar = {
        val showAppBar = true/false
        if (showAppBar) TopAppBar() //topBar shows/hides as expected based on some state
    }
) { innerPadding -> //but innerPadding never gets updated based on change in topBar visibility??
    //some content that consumes innerPadding
}
If this is actually supposed to work this way I might be forced to move TopBar onto specific screens?
a

Albert Chang

02/06/2023, 2:25 AM
Top bar height is not part of the
innerPadding
. The content of the
Scaffold
will always be placed below the top bar so there is no need to use its height as padding.
m

Marko Gajić

02/06/2023, 3:02 PM
This is Material3, and from my testing top bar height IS part of inner padding.. And I have to set it on my view to be fully visible under top bar..
4 Views