Instagram-like force touch popup modal

2019-07-06 22:30发布

I'm trying to replicate force touch functionality of Instagram where

1) Put your finger on an image and it gets a little darker (hover effect, easy)

2) Press a little harder and a popup modal preview of the content appears

3) Press even harder and it expands the modal to full screen

I'm having problems with Ionic 4/Cordova "3d touch" plugin where it doesn't register the force-touch if I regular-touch the screen first.

In order words, step 2 above does not trigger the force touch when listening via threeDeeTouch.watchForceTouches()

In order for the listener to trigger I have to go into the touch with force initially, with no delay between "touching" the screen and "pressing" the screen. If I touch the screen but do not press it, I can no longer press it to trigger force touch without lifting my finger first.

I'm testing on a real device, iPhone X

How is it possible to workaround this issue to replicate the force touch in Instagram?

0条回答
登录 后发表回答