我正在使用一个UIScrollview和UIimageview,这是UIScrollview的子视图,我想在UIImageview上使用UIPinchgesturerecognizer,但它不能正常工作。
答案 0 :(得分:0)
很简单,你可以像这样使用它:
yourImageView = [[UIImageView alloc] initWithImage:yourImage];
[yourScrollView addSubview:yourImageView];
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[yourImageView addGestureRecognizer:singleTap];
[sibgleTap release];
好运。
答案 1 :(得分:0)
我在谷歌搜索后得到答案,我禁用所有的scrollview手势,然后设置UIImageview的用户交互是,我使用此代码的UIScrollview的可用手势
for (UIGestureRecognizer* recognizer in [scrollviewFrame1 gestureRecognizers]) {
if ([recognizer isKindOfClass:[UIPinchGestureRecognizer class]]) {
[recognizer setEnabled:NO];
}
}