UITapGestureRecognizer not working in UIImageView

前端 未结 9 1651
长发绾君心
长发绾君心 2021-01-03 18:16

I had the following code:

UITapGestureRecognizer *showStoryTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showNewsStory         


        
9条回答
  •  孤独总比滥情好
    2021-01-03 19:06

    UITapGestureRecognizer *oneTouch=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(OneTouchHandeler)];
    
    [oneTouch setNumberOfTouchesRequired:1];
    
    [imageView addGestureRecognizer:oneTouch];
    
    imageView.userInteractionEnabled = YES;
    

提交回复
热议问题