给UIImageView添加点击事件

        UIImageView *imageview1 = [[UIImageView alloc] initWithFrame:CGRectMake(125, 50, 229, 229)];
        [imageview1 setImage:[UIImage imageWithContentsOfFile:path]];
        imageview1.userInteractionEnabled = YES;
        UITapGestureRecognizer *singleTap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonpress1:)];
        [imageview1 addGestureRecognizer:singleTap1];
        [singleTap1 release];
        [myScrollView addSubview:imageview1];
        [imageview1 release];

你可能感兴趣的:(action,Path)