简体   繁体   English

xcode模拟器可在iPad按钮图像上消失

[英]xcode simulator works on iPad button images disappear

I have my app working on the simulator just fine but when I install it on a iPad my 2 sets of buttons the button images disappear, here is the code, 我的应用程序可以在模拟器上正常运行,但是当我将其安装在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";
}

So btnImage2 and 3 just show blank buttons no images when you select the first button, this works fine in the simulator 因此,当您选择第一个按钮时,btnImage2和3仅显示空白按钮没有图像,这在模拟器中可以正常工作

看起来是区分大小写的!

First thing to check case sensitive of image name which you're using to refer to the resources. 检查要用于引用资源的图像名称区分大小写的第一件事。 iPhone is case sensitive, but simulator is not case sensitive. iPhone区分大小写,但模拟器不区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM