Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to cancel touch on tableview?
Started by ojnab Mar 13 2018 02:52 PM

4 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ojnab

[GLOBAL: userInfoPane.html]
ojnab
  • Contributor

  • 595 posts
  • Corona SDK

I am working on some custom swipe gestures added to a widget tableview. For example swipe up to bring up the keyboard. In order to do this I need to cancel touch on the tableview, when the swipe gesture action takes over.

 

I peeked in the tableview source code but can't really figure out what to do.

 

Any suggestions or help appreciated. Thanks



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,613 posts
  • Corona SDK

Why not defer bringing up the keyboard till the finger is lifted?

 

Am I misunderstanding?



[TOPIC: post.html]
#3

ojnab

[GLOBAL: userInfoPane.html]
ojnab
  • Contributor

  • 595 posts
  • Corona SDK

See the swipe gestures in apps like messenger and slack and you will know what I mean.

To do this kind of stuff I need to cancel the touch.



[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 2,131 posts
  • Corona SDK

Add a transparent rect on top of your app and decide which events to propagate to your UI below



[TOPIC: post.html]
#5

ojnab

[GLOBAL: userInfoPane.html]
ojnab
  • Contributor

  • 595 posts
  • Corona SDK

@SphereGS

That could be another approach.

 

I just found another solution though.

When the swipe gesture is recognised I set tableView.setIsLocked(true) and in the ended phase I unlock it again.

 

Thanks




[topic_controls]
[/topic_controls]