拖动&扫与iPhone上的可可粉 [英] Drag & sweep with Cocoa on iPhone

查看:114
本文介绍了拖动&扫与iPhone上的可可粉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始一个新的iPhone应用程式,需要一定的功能,但我不知道它是否可行。我愿意研究,但首先我只是想知道我是否应该至少考虑它。

I'm about to start a new iPhone app that requires a certain functionality but I'm not sure if it's doable. I'm willing to research but first I just wanted to know if I should at least consider it or not.

我没有在应用程序中看到这个是我的主要关注,即使我没有看到太多的应用程序,因为我没有iPhone),但一个例子将是iPhone快捷键面板:你可以持有一个应用程序,然后将其拖动到另一个面板,清扫,同时仍然拖动它。但这是核心应用程序,是否有可能在正常的应用程序中重现类似的东西?

I haven't seen this in an app before (which is my main concern, even though I haven't seen too many apps since I don't own an iPhone), but an example would be the iPhone shortcuts panels: you can hold on an app, and then drag it to another panel, sweeping while still dragging it. But this is the core app, is it possible to reproduce something similar within a normal app?

我只需要确保它可以在开始挖掘之前,我不需要代码示例或任何东西,但如果你有一些确切的资源,你认为有用的,那将是很感激。

I only need to be sure it can be done before I start digging, I don't need code examples or anything, but if you have some exact resources that you consider helpful, that would be appreciated.

谢谢!

推荐答案

是的。如果您在UIScrollView中有您的自定义UIView子类实例,您的视图控制器只需要设置UIScrollView延迟内容触摸,并不允许它取消触摸事件。

Yes. If you have your custom UIView subclass instance inside a UIScrollView, your view controller just needs to set the UIScrollView to delay content touches and not allow it to cancel touch events.

[scrollView setCanCancelContentTouches:NO];
[scrollView setDelaysContentTouches:YES];

当用户在自定义视图中点击并按住时,事件会转到该自定义视图,处理触摸事件以拖动项目,但如果用户快速滑动,则它滚动视图。

When the user taps and holds in the custom view, the event goes to that custom view, which can process the touch events to drag an item around, but if the user quickly swipes, it scrolls the view.

这篇关于拖动&扫与iPhone上的可可粉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆