简体   繁体   中英

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,

-(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

看起来是区分大小写的!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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