0

したがって、ビューでは、「A」としましょう。複数の UIImage ビューと UITextViews があります。現在、これはすべてプログラムで行われています。この同じビュー内で、私はこれを行っています:

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];

何らかの理由で、これは以前に割り当てたすべての UITapGestures (同じビュー内) を「キャンセル」しています (また、このコードは他のいくつかのビューで 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];
4

0 に答える 0