Objective c 背景蓝色按钮图像obj c

Objective c 背景蓝色按钮图像obj c,objective-c,iphone,background,Objective C,Iphone,Background,我给按钮分配了两种不同类型的图像 我发生了一些我无法理解的事情。。它为蓝色图像创建了一种背景 [self.shippingButton setBackgroundImage:[UIImage customImageWithName:@"terms_and_conditions_unselected"] forState:UIControlStateNormal]; [self.shippingButton setBackgroundImage:[UIImage custo

我给按钮分配了两种不同类型的图像

我发生了一些我无法理解的事情。。它为蓝色图像创建了一种背景

        [self.shippingButton setBackgroundImage:[UIImage customImageWithName:@"terms_and_conditions_unselected"] forState:UIControlStateNormal];
    [self.shippingButton setBackgroundImage:[UIImage customImageWithName:@"terms_and_conditions_selected"] forState:UIControlStateSelected];

    [self.billingButton setBackgroundImage:[UIImage customImageWithName:@"terms_and_conditions_unselected"] forState:UIControlStateNormal];
    [self.billingButton setBackgroundImage:[UIImage customImageWithName:@"terms_and_conditions_selected"] forState:UIControlStateSelected];


- (IBAction)shippingButtonChanged:(id)sender {
    self.shippingButton.selected = !self.shippingButton.selected;
}

- (IBAction)billingButtonChanged {
    self.billingButton.selected = !self.billingButton.selected;
}


为什么要将图像设置为背景?。直接设置为按钮前视图。类似于[self.shippingButton setImage:@“image.png”forState:]@我上传了图片,我试着用setImage,现在是…检查按钮背景颜色。不确定,但试着将btn.backGroundColor设置为白色。@phani不工作,兄弟。你们用故事板做按钮了吗?还是在程序上?如果以编程方式,则共享代码。情节提要,检查色调和背景颜色。