-(void)cellchange:(UITapGestureRecognizer *)recognizer
{
UIImage *cellselect=[UIImage imageNamed:@"radio_on_1.png"];
UIImage *cellunselet=[UIImage imageNamed:@"radio_off_1.png"];
UIImageView *img=(UIImageView *)recognizer.view;
for(int k=0;k<[ages count];k++)
{
if(img.tag==k)
{
UIImage *selectimg=img.image;
if([selectimg isEqual:cellselect])
{
img.image=[UIImage imageNamed:@"radio_off_1.png"];
}
if([selectimg isEqual:cellunselet])
{
img.image=[UIImage imageNamed:@"radio_on_1.png"];
}
}
}
}
所以请告诉我如何更改未选择的按钮图像。
答案 0 :(得分:1)
我认为更好的方法是使用'Button'而不是'Image'。点击时检查它是处于选定模式还是未选择模式,然后相应地设置图像按钮!