Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwanted white background visible around UITableView when rotating from landscape to portrait

I have a UITableView in an iPad application that I am working on. When I start in a portrait view and rotate to landscape, the view rotates and the rotation looks good.

However, when I rotate from landscape to portrait, there is a white edge that is displayed during the rotation. It appears as though the UITableView is resized to fit the portrait display at the beginning of the rotation. (When rotating TO landscape, resizing first means that no white will be seen.)

Through a few screenshots that I have been able to grab, it appears that the animation order is as follows:

  1. Resize UITableView
  2. Perform rotation animation
  3. Resize UIToolbar

While researching this, I found some people suggesting to change the UIWindow's background color to match your view (blue in this case), but my real UITableView does not have a solid color background, so this method is not sufficient.

I would like to be able to control when the rotation of individual views occur so that I can prevent this white border from being visible during rotation. Or if there is a better approach, please share that too!

[Edit] Here's a rough screenshot showing the white border during rotation:

enter image description here

like image 357
jmac Avatar asked May 05 '11 01:05

jmac


1 Answers

Try to set the background color of the window layer to [UIColor blackColor]

like image 200
DavidN Avatar answered Oct 30 '22 22:10

DavidN