我搜索了一些教程添加UIImage按钮的点击事件。如何URL路径添加添加URL图片按钮点击
图像button..For示例代码:
UIButton *imageView=[[UIButton alloc]initWithFrame:CGRectMake((320*index)+countFlag*80+ 2, 5, 75, 75)];
imageView.tag=i+1;
[imageView addTarget:self action:@selector(imageViewClicked:) forControlEvents:UIControlEventTouchUpInside];
[imageView.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[imageView.layer setBorderWidth:1.0f];
switch ((i+1)%5) {
case 0:
[imageView setImage:[UIImage imageNamed:@"img1.png"] forState:UIControlStateNormal];
break;
case 1:
[imageView setImage:[UIImage imageNamed:@"img2.png"] forState:UIControlStateNormal];
break;
}
你想显示带背景图像的按钮? – Balu 2013-03-21 11:56:14
使用EGOButton作为URL。 – 2013-03-21 11:59:08