简体   繁体   English

在OS 3.0中取消iPhone触摸

[英]iPhone touch cancelling in OS 3.0

I have a new iPhone app that has the following (and only the following) UIView heirarchy: 我有一个新的iPhone应用程序,它具有以下(并且仅以下) UIView层次结构:

UIWindow -> UIScrollView -> UIViewSubclass

The UIScrollView is the view of a UIViewController . UIScrollViewUIViewControllerview In UIViewSubclass I want to be tracking and responding to touch events and have set up the "standard four" handling routines therein. UIViewSubclass我想跟踪和响应触摸事件,并在其中设置了“标准的四个”处理例程。 Under the Simulator running the 2.2.1 OS everything works as expected. 在运行2.2.1 OS的模拟器下,一切正常。 However under the Simulator running under the 3.0 OS I'm getting the same "event eating" exhibited by the new UITextView behavior . 但是,在运行于3.0 OS上的模拟器下,新的UITextView行为表现出相同的“事件吞噬” As said before though I don't have a UITextView anywhere in my app. 如前所述,尽管我的应用程序中没有任何地方的UITextView

What's eating my touch events, and how do I keep it from doing so? 我的触摸事件在吃什么,如何避免这样做? I've heard I need to override canPerformAction:withSender: in every view in my hierarchy; 我听说我需要在层次结构的每个视图中覆盖canPerformAction:withSender: say it isn't so! 说不是!

Not sure if this is the same problem, but try setting the UIScrollView's “canCancelContentTouches” property to NO. 不知道这是否是相同的问题,但是请尝试将UIScrollView的“ canCancelContentTouches”属性设置为NO。

http://www.alexc.me/uiscrollview-and-uidatepicker/153/ http://www.alexc.me/uiscrollview-and-uidatepicker/153/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM