Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Getting touchstart Events to fire on a ScrollView with long content

$
0
0

I have an iPhone app developed using Titanium SDK 3.1.1 GA with a UI created using Alloy views. I've tested on iOS 6.1 using the simulator (under OS X 10.8) and on an iPad 2. I'm also getting the same result in a barebones test app. Basically, I have a ScrollView for which I want to capture touchstart events. When the content of the ScrollView is shorter than the height of the ScrollView or scrollingEnabled is set to false, the event fires as expected. When scrolling is enabled and the content extends beyond the visible area of the ScrollView such that it must scroll in order to view all content, then the touchstart event does not fire. (I was able to get it to fire on a handful of occasions by rapidly swiping across the ScrollView, but this was very inconsistent.)

It seems as if the act of scrolling seems to consume the touchstart event and I never see it, but in my case, I need to track touches moving horizontally across this view for a navigation drawer / slide menu implementation. The best workaround I have so far is just to also look for longpress events, as they always fire along with touchmove events. However, this forces the user to be more "deliberate" in the way they try to slide the view when the content can scroll, and I don't like inconsistency in the UI.

I've tried playing with some of the ScrollView properties in the hopes that something would change this behavior and allow the touchstart event to always fire, but I've turned up nothing so far. Is there any way to capture the touchstart event on a ScrollView that scrolls?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>