Home > database >  How To Get The Absolute Position Of My Composable Function/Children?
How To Get The Absolute Position Of My Composable Function/Children?

Time:11-16

I have tried to use enter image description here

EDIT:2

The order of modifier should not matter since the function onGloballyPositioned states that.

This callback will be invoked at least once when the LayoutCoordinates are available, and every time the element's position changes within the window.

The same is true for onSizeChanged and can be observed by running the code below (same example as in the answer by @Thracian.)

Invoked with the size of the modified Compose UI element when the element is first measured or when the size of the element changes.

Since the function is literally a callback the order shouldn't matter. If im wrong with this pls feel free to correct me.

    Box(modifier = Modifier
        .onSizeChanged {
            println("           
  • Related