如何在下一个按钮点击更改图像+ iphone
问题描述:
我想要使用uiimage视图在下一个按钮点击时更改图像。我正在使用以下链接来获取图像。如何在下一个按钮点击更改图像+ iphone
http://01s.in/webservices/ratemypic/getData.php?db_table=image
感谢所有
答
//Are you getting the image or not ...
//if yes then just make the button action method let say......
changeImage:(id)sender{
UIButton *btn = (UIButton*)sender
[btn setImage:yourUIImage forControlState:UIControleStateNormal];
}
答
只是用波纹线的时候要更改按钮图像...
[yourButton setImage:[UIImage imageWithName:@"yourImageName"] forControlState:UIControleStateNormal];
答
首先分析这个字符串使用
NSArray *tempArry = [firstArryStr [email protected]".png"];
现在tempArray将包含图像names.In按钮操作可以使用索引(其为静态无功)中的ImageView迭代这个阵列和显示图像,如下所示:
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.png"],[tempArray objectAtIndex:index]];
index++;
,并检查是否索引== [tempArray长度] ,然后将其重置为0.在UIImageView中使用此图像。