Search code examples
iphoneiosuiviewcontrolleruiviewanimationtransition

What would cause the iPhone home screen to be visible behind a modal flip transition?


On some occasions, not every time, when my app presents a modal view controller using presentModalViewController:animated: with modalTransitionStyle set to UIModalTransitionStyleFlipHorizontal the iPhone home screen is visible behind the animation. Most of the time the background is black as expected. There is nothing abnormal where I set up the window or rootViewController (a UITabBarController). I blacked out my app UI but you can see the issue in the screen shot taken with an iPhone 4 while the transition is in progress.

What would cause this? I don't know how to do it even if I wanted this behavior.

EDIT: This screen shot was sent to me by a tester, I haven't repro'ed it myself. They told me it occurred during a particular app session and once it occurred it happened for all transitions. When they quit/relaunched the app it didn't happen again and they haven't seen it since. I'm wondering whether it's something I need to be concerned about (i.e. I can prevent it in code).

EDIT 2: This app does not use IB. All controllers/views are created in code.

enter image description here


Solution

  • I've had the same problem before. Try using [viewController.view setBackgroundColor:[UIColor blackColor]]; on the view your pushing. Worked for me anyways!