Alex
07/05/2021, 5:31 PMAlex
07/05/2021, 5:32 PMBoxWithConstraints {
TopAppBar(
...
)
}
I would like to get the height of the TopAppBar here and store it in a remember{ mutableStateOf() }
to use in other parts of the code.dimsuz
07/05/2021, 5:32 PMModifier.onGloballyPositioned
brandonmcansh
07/05/2021, 6:40 PMbrandonmcansh
07/05/2021, 6:40 PMcb
07/05/2021, 7:57 PMSubcomposeLayout
(Scaffold
is a good example). If you don't need to influence composition you can use Layout().
Modifier.onSizeChanged()
or onGloballyPositioned()
can easily result in composition loops, so should only be used as a last resort and with care.