我在 ViewController 中实现了 iCarousel 方法,一切正常,但有一件事,我想在轮播视图标签下方添加,对于每个图像,我想更改此标签区域中的文本。这是我用于将每个图像创建为按钮的代码。
提前致谢。
UIImage *buttonImage =[NSArray arrayWithObjects:[UIImage imageNamed:@"Hotels.png"],
[UIImage imageNamed:@"image2.png"],
[UIImage imageNamed:@"image3.png"],
[UIImage imageNamed:@"image4.png"],
[UIImage imageNamed:@"image1.png"],
[UIImage imageNamed:@"FastFood.png"],
[UIImage imageNamed:@"Taxi.png"],nil];
UIButton *button =[UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 200.0f, 200.0f);
[button setImage:[buttonImage objectAtIndex:index]forState:UIControlStateNormal]; [按钮 addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; 返回按钮;