doomsower / react-native-modal-popover

React-Native pure JS popover that uses Modal
MIT License
322 stars 45 forks source link

How to show in center of screen #37

Closed ansarikhurshid786 closed 5 years ago

ansarikhurshid786 commented 5 years ago

it is working perfectly. i am facing issue to get value of x,y,widh and height.

can someone help me to show middle of screen ?

doomsower commented 5 years ago

This module is about popovers which are anchored to other views. If you need to display it in the middle of the screen, simple modal or react-native-modal should suffice.

ansarikhurshid786 commented 5 years ago

how to get x,y,height and widht value ?

doomsower commented 5 years ago

Of what? Anchor element or popover content? Use onLayout or measure. Or is that module internals prevent you from tapping into these methods?

ansarikhurshid786 commented 5 years ago

can you please give me sample code of onLayout or measure? I tried measure but measure is not a function.

doomsower commented 5 years ago

Just search the source code of this project. I use both onLayout and measure here.

ansarikhurshid786 commented 5 years ago

ok thanks for your reply. i am using modal. i tried a lot but not working(onlayout, measure, measurelayout)