我想用两个图像更改按钮的外观,一个是正常状态,另一个是选择时突出显示/选定状态,但我不知道如何,我试过这个:
UIImage *buttonImage_Home = [UIImage imageNamed:@"upload.png"];
UIImage *stretchableButtonImageNormal = [buttonImage_Home stretchableImageWithLeftCapWidth:12 topCapHeight:0];
UIButton *homeButton = (UIButton *)[self.view viewWithTag:2];
[homeButton setBackgroundImage:stretchableButtonImageNormal forState:UIControlStateNormal];
它有效,但如果按下/触摸我不知道如何添加第二张图片,请帮帮我