Objective c 从序列图像板添加controllerview将取消在我的视图中指定给UIImageView的Tap手势
在一个视图中,比如说“a”,我有多个UIImage视图和UIExtView。现在,所有这些都是通过编程完成的。在同样的观点下,我正在这样做:Objective c 从序列图像板添加controllerview将取消在我的视图中指定给UIImageView的Tap手势,objective-c,ios,uiimageview,ios6,uistoryboard,Objective C,Ios,Uiimageview,Ios6,Uistoryboard,在一个视图中,比如说“a”,我有多个UIImage视图和UIExtView。现在,所有这些都是通过编程完成的。在同样的观点下,我正在这样做: if(!_productionLinesCollectionViewController) { _productionLinesCollectionViewController = [[self storyboard]instantiateViewControllerWithIdentifier:@"ProductionLinesCollectio
if(!_productionLinesCollectionViewController)
{
_productionLinesCollectionViewController = [[self storyboard]instantiateViewControllerWithIdentifier:@"ProductionLinesCollection"];
_productionLinesCollectionViewController.productionLines = [_plant.productionLines allObjects];
_productionLinesCollectionViewController.initX = 0;
_productionLinesCollectionViewController.initY = _totalHeight;
_productionLinesCollectionViewController.width = 668;
}
[self.scrollView addSubview:_productionLinesCollectionViewController.view];
现在由于某种原因,这是“取消”我之前分配的所有UITapPictures(在同一个视图中)(同样,这段代码在其他一些视图中100%工作)。每当我删除这段代码时,我的手势就会再次起作用。你知道为什么吗
谢谢
UIImageView *playMovieImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"press_to_play.png"]];
playMovieImage.frame = CGRectMake(30, _totalHeight, 608, 456);
UITapGestureRecognizer *tapRecognizer;
tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(playMovie:)];
[playMovieImage addGestureRecognizer:tapRecognizer];
playMovieImage.userInteractionEnabled = YES;
[self.scrollView addSubview:playMovieImage];
您的imageview是否覆盖了整个UIView?否则,当您点击外部图像视图时,它会检测到之前的手势。它不会覆盖整个。。。就好像故事板中的新UIViewController阻止识别任何手势一样。。。。。