0

I have work on touch event but that would be not work because of I take imageView in ScrollView so,that when I touch the image that directly work scrollview but not work touch on image so give any suggestion and source code which is apply in my code.....

4

1 回答 1

1

正如 frauen1 在他们的回答中所说

1) 在 UIScrollView 类中,将 canCancelContentTouches 的值设置为 NO - 这告诉 UIScrollView 类允许在子视图中进行触摸(或者,在这种情况下,在子视图的子视图中)。

2)在我的“卡片”类中,将 ExclusiveTouch 设置为 YES - 这告诉子视图它拥有其中的触摸。

现在它将允许使用以下代码双击 ImageView

 UITapGestureRecognizer *tapRecognizer;
    self.imgViewGVC.userInteractionEnabled = YES;
    tapRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTapView:)];
    tapRecognizer.numberOfTapsRequired = 2;
    [self.ImageView addGestureRecognizer:tapRecognizer];
[tapRecognizer release];
于 2012-05-21T09:38:57.800 回答