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 (ie I can prevent it in code).
EDIT 2: This app does not use IB. All controllers/views are created in code.
I've had the same problem before. Try using [viewController.view setBackgroundColor:[UIColor blackColor]];
on the view your pushing. Worked for me anyways!
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.
Instructions to fixing this problem:
Hope this helps :)
I'm not sure but I think this may be caused by a bug or modification to the main 'UIApplication.h' code, a problem with the iOS or an issue with the version of Xcode you have.
Seb
I saw this issue happening even with Facebook iPhone App. Maybe it is Apple's bug.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.