Home > Mobile >  What is the alternative of view.x and view.y in android jetpack compose...?
What is the alternative of view.x and view.y in android jetpack compose...?

Time:03-17

I wants to get coordinates of a view in jetpack compose like we get in android by using following code...i.e view.x and view.y that gives you x and y coordinates how we can achieve this in jetpack compose....?

CodePudding user response:

You can use the Modifier's onGloballyPositioned method and retrieve its coordinates (from its parent or the root screen) from the layoutParameter passed down in the lambda

  • Related