我想在另一张图片上显示一张图片。基本上我试图显示该框已选中。问题是,当单击未选中的图像时,会出现复选按钮,但复选框会熄灭。我希望复选符号出现在复选框的顶部。
代码如下所示:
if (ShopCartUnedited) {
[button setBackgroundImage:[UIImage imageNamed:@"none.png"] forState:UIControlStateNormal];
[arrOfObjects addObject:@"NO"];
}
else {
if (counter+1 <= nQty) {
[button setBackgroundImage:[UIImage imageNamed:@"check2.png"] forState:UIControlStateNormal];
[arrOfObjects addObject:@"YES"];
}
else {
[button setBackgroundImage:[UIImage imageNamed:@"none.png"] forState:UIControlStateNormal];
[arrOfObjects addObject:@"NO"];
}
}
如果单击时,我如何更改 check2.png 位于 none.png 之上...