我的应用程序在模拟器上运行得很好,但是当我在 iPad 上安装它时,我的 2 组按钮按钮图像消失了,这是代码,
-(IBAction)ButtonNot1:(id)sender{
UIImage *btnImage1 = [UIImage imageNamed:@"button_Not_At_all_R.png"];
[sender setImage:btnImage1 forState:UIControlStateNormal];
UIImage *btnImage2 = [UIImage imageNamed:@"Button_Unsure.png"];
UIImage *btnImage3 = [UIImage imageNamed:@"Button_Definitely.png"];
UIButton* ButtonUn1 = (UIButton*)[self.view viewWithTag:2];
UIButton* ButtonDef1 = (UIButton*)[self.view viewWithTag:3];
[ButtonUn1 setImage:btnImage2 forState:UIControlStateNormal];
[ButtonDef1 setImage:btnImage3 forState:UIControlStateNormal];
sResults1 = @"1";
}
因此,当您选择第一个按钮时,btnImage2 和 3 只显示空白按钮没有图像,这在模拟器中工作正常