直接上代码:
imageView1.userInteractionEnabled=YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickTap:)];
[imageView1 addGestureRecognizer:tap];
[tap release];
//* 点击事件 */
-(void)clickTap:(id)sender
{
BViewController *view = [[[BViewController alloc]initWithNibName:@"BViewController" bundle:nil]autorelease];
[self.navigationController pushViewController:view animated:YES];
}