I am trying to set the background color with a checkered image I have. I am currently using this in my iPhone app and now am trying to create a universal app. When I use this:
UIImage *bgimg = [UIImage imageNamed:@"square_bg.png"];
self.view.backgroundColor = [UIColor colorWithPatternImage:bgimg];
It works fine for my iPhone app. When it loads on the iPad in portrait mode, there is about 20px worth of white space at the bottom. When it loads in landscape, it is fine. If I rotate from portrait to landscape, then back again, it is also fine.
What am I missing that will fill the pattern all the way to the bottom of my view?
Update
If I set the color to a solid color, [UIColor blueColor], the entire screen fills in correctly. So why the discrepancy from colorWithPatternImage and a solid color?
Update 2
The file I am using is a PNG file with dimensions of 252×230. I’ve used this image to make patterns in the iPhone version of this app with no issues. I’m not sure if the file size or dimensions have any bearing on this issue, but I thought I would put it out there just in case.
20px sounds like the status bar height. Could you tell us the view frame?
Is your autoresizing set correctly to dynamic width & height and fixed borders?