How to Get AppBarHeight from AppBar.kt in Compose Android

55 views Asked by At

I want to get this value in AppBar.kt

private val AppBarHeight = 56.dp

I'm using the TopAppBar in a Scaffold and need to know its height, how can I retrieve this value without hard-coding it where I use it? I want to avoid declaring a dimen value for this if possible and measuring the UI element.

1

There are 1 answers

0
Eliza Camber On BEST ANSWER

With a quick look at the code I don't think this is possible. So, the height of the AppBar is set like this: enter image description here

but the `TopAppBar_Tokens are an internal object: enter image description here