我正在更改按钮单击时的 UIButton 图像,但它会从原始位置更改为左侧。我不知道为什么会这样。下面是按钮。当我选择第二个按钮时,它会改变图像并到达左侧。我该如何解决这个错误?
下面是我的代码
-(IBAction)locationOneButtonAction{
UIImage *buttonImage = [UIImage imageNamed:@"radiogreen.png"];
UIImage *buttonImageOne=[UIImage imageNamed:@"radiowhite.png"];
[locationOneButton setImage:buttonImage forState:UIControlStateNormal];
[locationOneButton setImage:buttonImage forState:UIControlStateNormal];
[locationThreeButton setImage:buttonImageOne forState:UIControlStateNormal];
[locationTwoButton setImage:buttonImageOne forState:UIControlStateNormal];
[locationFourButton setImage:buttonImageOne forState:UIControlStateNormal];
[locationFiveButton setImage:buttonImageOne forState:UIControlStateNormal];
[locationSixButton setImage:buttonImageOne forState:UIControlStateNormal];
resturantLocation=@"Common Man - Bedford, MA";
}