I am trying to make tinder cards so when you swipe it shows another card underneath. It works fine but I can’t get the cards to stack on top of each other. It instead lists the cards as if it is a vertical list. My code is pretty basic but here is a snippet:
I am new with ionic and i am loking for a way to make my cards swipables, i tried with swing packaga following a tutorial but it didn’t work, i am trying to implement it with itemSliding but i think thut would to be a better way, can you tell me how did you implement ?
Basically you need to get the screen width which I do with $window.innerWidth. Multiply that by some constant of how far the user must drag. My constant is stored as a percent of the screen so I multiply it by the full width. Ex: Screen width is 720px * 0.3 of the screen. This means nothing will happen unless the user drags at least a third of the screen.
On release, you need to check to see if the distance dragged is greater than the threshold before you do any logic. The dragLeft and dragRight functions for me allows me to set some property on the object so that I can displahy an image to the user to notify him to he is dragging.