iphone imageview 点击事件 click

NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://img.baidu.com/hi/img/ihome/logo.gif"]];
    UIImage *img=[UIImage imageWithData:data];
    UIImageView *imgView=[[UIImageView alloc] initWithImage:img];
    imageView.image = imgView.image;
    imageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageClicked)];
    [imageView addGestureRecognizer:singleTap];    
    [self.view addSubview:imageView];
    NSLog(@"imageClick");

你可能感兴趣的:(ios,iPhone,imageview,图片点击)