【发布时间】:2011-02-12 16:25:47
【问题描述】:
我有一个水平滚动的 UIScrollView。我还让我自己的处理程序在垂直滚动上做一些不同的事情。这确实很好用,但是我使用以下代码在 UIScrollView 上添加了一些按钮:
UIButton *catButton = [UIButton buttonWithType:UIButtonTypeCustom];
[catButton addTarget:self action:@selector(clickCatButton:) forControlEvents: UIControlEventTouchUpInside];
按钮的动作在点击时被调用:
- (void) clickCatButton:(id) sender
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];
}
但我的问题是,由于将按钮放在 UIScrollView 上,它们接管了管理垂直滚动的代码。
我有点不知道解决这个问题的最佳方法是什么。
感谢您的帮助
【问题讨论】:
标签: iphone uiscrollview uibutton touch