如何阻止触摸开始和触摸结束方法?

发布于 2025-01-06 10:10:16 字数 945 浏览 2 评论 0原文

在我的 iPad 应用程序中,我有一个名为 cell 的类。

当我触摸单元格时,触摸委托方法的执行顺序如下:

1)触摸开始

2)触摸移动

3)触摸结束

有没有一种方法可以为一个单元格调用这三种方法?

我希望首先为一个单元格调用所有三种方法,然后为其他单元格调用。

理想情况这应该发生。

                                                     Touches Began 13
2012-02-20 09:52:21.918 ShuffleDemoForiPad[3038:707] Touches Ended 13

2012-02-20 09:52:21.536 ShuffleDemoForiPad[3038:707] Touches Began 14
2012-02-20 09:52:21.566 ShuffleDemoForiPad[3038:707] Touches Ended 14

If it ommits the touch for cell 14 is also absolutely acceptable.

发生的事情缺少顺序,因此会得到不良结果。

                                                     Touches Began 13
2012-02-20 09:52:21.536 ShuffleDemoForiPad[3038:707] Touches Began 14
2012-02-20 09:52:21.538 ShuffleDemoForiPad[3038:707] Touches Ended 13
2012-02-20 09:52:21.566 ShuffleDemoForiPad[3038:707] Touches Ended 14

谢谢。

In my iPad app I have a class called cell.

When I touch the cell, order of execution of the delegate methods for touch is as follows:

1) Touches Began

2) Touches Moved

3) Touches Ended

Is there a way I can call these three methods for one cell?

I want all three methods to be called first for one cell, and then for the other cells.

Ideally this should happen.

                                                     Touches Began 13
2012-02-20 09:52:21.918 ShuffleDemoForiPad[3038:707] Touches Ended 13

2012-02-20 09:52:21.536 ShuffleDemoForiPad[3038:707] Touches Began 14
2012-02-20 09:52:21.566 ShuffleDemoForiPad[3038:707] Touches Ended 14

If it ommits the touch for cell 14 is also absolutely acceptable.

What is happening is missing the sequence, so getting undesirable results.

                                                     Touches Began 13
2012-02-20 09:52:21.536 ShuffleDemoForiPad[3038:707] Touches Began 14
2012-02-20 09:52:21.538 ShuffleDemoForiPad[3038:707] Touches Ended 13
2012-02-20 09:52:21.566 ShuffleDemoForiPad[3038:707] Touches Ended 14

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

强者自强 2025-01-13 10:10:16

我只是猜测您想跳过编号为 0、2、4、6 的单元格的用户交互......所以这可能可以帮助您。

if (indexPath.row%2==0)
{
    cell.userInteractionEnabled = NO;
}
else
{
    cell.userInteractionEnabled = YES;
}

I am just guessing that you want to skip cell's user interactions for cell numbered 0,2,4,6..... So may be this can help you.

if (indexPath.row%2==0)
{
    cell.userInteractionEnabled = NO;
}
else
{
    cell.userInteractionEnabled = YES;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文