How to position popup/flyout with respect to screen #10812
-
Given a flyout of width X%, I want to horizontally align it to the center of the screen and 100px from the top of the screen. By default, it looks like this If I give it a vertical offset of 100px, it looks like this Is there a way to horizontally center the flyout without using a fixed horizontal offset number? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you check out the Gallery app (https://github.com/microsoft/react-native-gallery) it has examples of positioning Flyouts. Both a fixed offset and attaching to position near an element. For your situation where you want one part fixed (the top margin) and the rest proportional (half width), I don't know if you can do that. The offsets are just numeric. You could create an element that is in the spot you want the Flyout and is invisible and then position to that? Kind of annoying, but that might work? |
Beta Was this translation helpful? Give feedback.
If you check out the Gallery app (https://github.com/microsoft/react-native-gallery) it has examples of positioning Flyouts. Both a fixed offset and attaching to position near an element.
For your situation where you want one part fixed (the top margin) and the rest proportional (half width), I don't know if you can do that. The offsets are just numeric.
You could create an element that is in the spot you want the Flyout and is invisible and then position to that? Kind of annoying, but that might work?