views:

255

answers:

2

When rotating a View from UIInterfaceOrientationPortrait to UIInterfaceOrientationPortraitUpsideDown on the iPad simulator, there is a white border along one side of the view (see diagram, lower left of the image). The white border shows only on one side, but not the opposite side. How can I prevent (hide) it? Thanks!

+5  A: 

This is a guess:

It's possible that one of your views has a backgroundColor set to white, and it is completely covered by another view. During a rotation, perhaps floating point errors cause one border to show slightly through that edge.

To investigate this case, you can use the undocumented method [UIView recursiveDescription] to get a quick look at your view hierarchy (no need to submit code with that method, it's just for debugging). Once you know which views are near the bottom, you can print out their backgroundColors, or just set them all to [UIColor clearColor].

Also, I'm guessing you already know this one, but it can be useful to set window.backgroundColor = [UIColor clearColor] at the start of your code!

Tyler
Thanks Tyler! window.backgroundColor = [UIColor clearColor]; works!!
ohho
A: 

I had the same issue. I saw that in Interface builder autosizing for the view could not be enabled. I deleted the .xib and re-created it making sure product was set to "ipad" when creating the file (add new file in xcode).

jamihash