Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use gestures on iPhone apps using Delphi Firemonkey?

I am trying to write an iPhone app using Delphi XE2 / FireMonkey and have got past many of the initial hurdles, but am now stuck on gesture handling.

I have created a test app with a TVertScrollBox, but I cannot scroll the contents, unless I enable the scroll bars (which are very thin), and touch those. This is not very iPhone friendly (and almost unusable). Would appreciate a pointer in the right direction.

Documentation seems to suggest using UIGestureRecognizer...

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html

...however these need to be attached to a View, whereas the app is using a FireMonkey form.

Any thoughts would be appreciated.

like image 342
Peter Avatar asked Oct 25 '11 02:10

Peter


2 Answers

I have worked out how to do this...

The TVertScrollBox control needs to have the MouseTracking property set to True.

All controls added to the TVertScrollBox then need to have their HitTest property (if it exists) set to False. After that it just works!

like image 112
Peter Avatar answered Nov 15 '22 07:11

Peter


With Delphi Xe3, Fire monkey as support for basic gestures (zoom, rotation, pan) But officially Xe3 doesn't support anymore "IOS" as a target. You have to wait beginning of 2013 for the release of their "mobile studio" extension

like image 44
Sisko Avatar answered Nov 15 '22 07:11

Sisko