English 中文(简体)
ios uiscrollview 只对垂直擦拭进行延迟
原标题:ios uiscrollview delayscontenttouches only for vertical swipe

I am using a UIScrollView on the right side of my UIView. The ScrolView containes many UIImageView items and I allow only vertical scroling on the scrollview. The ImageView items can be dragged outside the scrollview to be placed on another view. The UIScrollview is set to delaysContentTouches = YES. This allows the nice feature of quickly scrolling the bar even when touching on one of it s content items, but on the other hand it introduces that little delay of about 0.15 seconds, when one of the content items is touched to be dragged into the other view.

设置延迟 ContentTouches = NO, 允许以水平擦拭手势拖动内容项, 但当然不允许垂直擦拭手势的滚动视图垂直滚动 。

所以我想保留延迟 ContentTouches =是的, 但不知何故只用在垂直的擦拭手势上, 而对于水平的擦拭, 我想要一种行为, 好像延迟 ContentTouches = NO

有什么建议吗?

提前感谢

问题回答

尝试设置延迟 ContentTouches =Y 并安排内容视图宽度以等同滚动视图宽度,这样就不可能进行水平滚动 。

pan 手势识别器 might 快速确认没有 H 滚动的可能性, 从而提前结束延迟 。 或者只有在没有 H 或 V 滚动可能时才有效 。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签