您的位置:首页 > 产品设计 > UI/UE

iphone开发笔记:为UIImageView添加点击事件

2012-12-07 16:47 459 查看

直接上代码:

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];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: