Expose absolute coordinates of widgets on contentview
See original GitHub issueCurrently laid out widget coordinates relative to its parent are exposed by the bounds
property. Access to absolute position of a widget on the screen may be useful for advanced animations.
Use case example: scroll view with complex layout. Goal: pop-up animation, scaling an arbitrary scroll view child widget to fit the screen (e.g. modal image details view with a fluid animation). Implementation suggestion:
- get the absolute coordinates of the widget.
- create a second twin widget and append it to the page using the absolute coordinates from (1).
- set visible of the first widget to
false
. - animate the widget from (2).
Currently (1) is only possible by manually calculating the absolute coordinates of the widget (not easy with complex layouts) respecting the current scroll position.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Absolute positioning for SwiftUI views - a free Hacking with iOS
SwiftUI gives us two ways of positioning views: absolute positions using position() , and relative positions using offset() .
Read more >saving state on compound view widgets - Stack Overflow
How do you save view widget instance state when, by using XML-defined widget layouts, components of the individual widget instances all have the...
Read more >AbsoluteLayout - Android Developers
A layout that lets you specify exact locations (x/y coordinates) of its children. Absolute layouts are less flexible and harder to maintain than...
Read more >https://unpkg.com/tabris@3.8.0/tabris.d.ts
To be passed to a JSX element or new-less * widget constructor call. ... Otherwise the image might turn out incorrectly exposed.
Read more >Navigation Drawers and Such
For example, M9,2 means move to absolute coordinates (9,2), but m9,2 means move 9 in the x direction and 2 in the y...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Negative bounds have never been supported on Android. We added clarified this in the documentation accordingly. The idea to get the view bounds is still valid though. For the moment you could traverse up the view hierarchy in a
resize
callback and add up the top/left coordinates.@cookieguru Thanks for the heads up. Closing as resolved.