Why can't I see the background image in the device, but it appears in the simulator?

Here is the viewDidLoad:

[self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.png"]]];

      

It can display the simulator, but not on the device, why? THz.

+2


a source to share


2 answers


Also check that the image is not a PSD with a PNG extension. The simulator can show PSD images, the device cannot. :)



+5


a source


The device is case sensitive, so make sure you have bg.png for sure.



+3


a source







All Articles