1

有没有人在 UITableView 上的 iOS 模拟器中捏捏的问题?我有这个代码:

UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinch:)];
[self.tableView1 addGestureRecognizer:pinch];
[pinch release];

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTouch:)];
[self.tableView1 addGestureRecognizer:tap];
[tap release];

在我的 viewDidLoad 方法中。在我的 handlePinch: 和 handleTap: 方法中,我只是简单地使用 NSLog(@"pinched") 或 @"tapped"。水龙头工作,但捏没有。模拟器中是否存在错误,或者我没有为 UITableView 正确模拟它?(按住两个圆圈的选项键,点击鼠标,然后拖动模拟捏合)

编辑:我为 tableView 选择了 multiTouchEnabled,但它无法识别捏合。但是,如果我更改外部容器 UIView 并将 pinchgesture 添加到 UIView,那么它似乎可以工作。但是我认为如果外部 UIView 没有根据文档寻找 pinchgesture,它不应该工作。

4

1 回答 1

4

如果您使用的是 XIB,则很可能multipleTouchEnabledNO. 将其设置YES为捏合工作。

于 2011-06-09T19:10:58.757 回答