Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 467
XJones Avatar asked Dec 29 '11 23:12

XJones


People also ask

How do you fix iPhone transitions?

Open Settings and go to “General” followed by “Accessibility” Navigate to and select “Reduce Motion” Toggle this setting switch to the ON position. Exit out of Settings to instantly see the difference in transition effects.

What is the parallax effect on iPhone?

Parallax effect where your wallpaper, apps, and alerts that move or shift slightly as you tilt your device are disabled. Animation and effects in certain apps are disabled. For example, weather animations in the Weather app.

How do I turn off screen transition on iPhone?

How to disable motion on iPhone or iPad. Open the Settings app and tap Accessibility. Select Motion. Turn on Reduce Motion to disable the screen animations.


2 Answers

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

like image 65
Chad Avatar answered Oct 19 '22 22:10

Chad


This happens when iOS sends memory warning to the app and the app's framework automatically dumps all the view components which are not visible, except the data structures related to the viewController will stay, and when there is a refer to the view it will load the view from the nib again ( in your case loadView is called I guess) you should make sure your view construction code is reconstructable and nullify all objects related to the view components in viewDidUnload method of your view controller.

You can also make it happen by running your app by simulator and when you are in that modal view, trigger the "Memory Warning" simulation from the "Device" menu on the top of your computer screen.

like image 31
Rhm Akbari Avatar answered Oct 19 '22 23:10

Rhm Akbari