Closed PorridgeBear closed 10 years ago
This has something to do with how Apple handles the view hierarchy. During the presenting animation, the underlying view is still visible, but as soon the new view is presented fully, the underlying layers are purged from the screen for performance reasons. That is why you can't do transparent modal views out of the box. But you can try to fumble around with UIModalPresentationCustom and transitioningDelegate (from iOS 7 and up). This gives you access to the presenting and presented view controller. There was also a talk on this and other cool stuff on WWDC 13, called "Implementing Engaging UI on iOS"
Just like check button commented, this is not problem with ILTranslucentView. You will get same effect if you use normal and transparent UIView.
Presenting a new view controller with presentViewController
[viewController presentViewController:newViewController true completion:nil];
You see the translucent layer animate up but when it finishes it overwrites the translucent layer with a grey/black layer (depending on the translucentAlpha value).
Any idea for how to prevent this grey/black layer being shown at the end of a presentViewController animation?
The newViewController's view is set to a custom view that is inheriting ILTranslucentView - I note that this is not in your usage instructions - it mostly works except for this black screen at the end.