In React Native iOS, I would like to slide in and out a like to following in the picture.
In the following example, when a button is pressed, the Payment Information
view pops up from the bottom and when the collapse button is pressed, it goes back down and disappears.
What would be the correct and proper way to go about doing so?
Thank you in advance!
EDIT
I know it is a little bit late, but thought it might be useful for someone. You should try out a component called
rn-sliding-out-panel
. It works awesomely. https://github.com/octopitus/rn-sliding-up-panelAnd you can even open it from an external button:
You can install it via npm:
sudo npm install rn-sliding-out-panel --save
on your react-native root directory.I hope it helps someone :D
Basically, you need to absolute-position your view to the bottom of the screen. Then you translate its y value to equal its height. (The sub view must have a specific height in order to know how much to move it)
Here's a playground showing the result: https://rnplay.org/apps/n9Gxfg
Code: