【发布时间】:2010-06-28 11:04:59
【问题描述】:
我想在导航栏中显示图像,而不是带有操作的后退按钮。所以现在我使用了图像视图并在导航栏中显示了图像。现在我想为图像视图编写动作,当触摸或单击图像视图时。是否可以为图像视图编写动作?
我目前正在使用 iPhone OS 4.0。
这是我的代码:
UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0,5,40,40)];
[self.navigationController.navigationBar addSubview:view1];
view1.backgroundColor = [UIColor clearColor];
UIImage *img = [UIImage imageNamed:@"Back.png"];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
[view1 addSubview:imgView];
如何编写图像视图的操作?
【问题讨论】:
标签: iphone uiimageview touch