图形上加点击事件

resizedImageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(photoTapped)];
    [resizedImageView addGestureRecognizer:singleTap];//点击图片事件
    NSLog(@"haha");
    [self.view addSubview:resizedImageView];//加载图片
//该片段来自于http://outofmemory.cn

手势代码:

    tapPage3userInteractionEnabled = YES;

若是要尚未影响, 设置

创造而的imageView,名字让 tapPage3

     UITapGestureRecognizer
*tapGesturRecognizer=[[UITapGestureRecognizer
alloc]initWithTarget:self action:@selector(tapPage3)];

    [page3  addGestureRecognizer:tapGesturRecognizer];

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图