UIVisualEffectView changing bounds incorrectly on orientation change

575 views Asked by At

I have a problem that is bugging me like hell. I have a custom view on top of my apps main view for settings configuration. The background of this view uses a UIVisualEffectView. However, my app supports both Portrait and Landscape mode and when changing the orientation, the auto-resizing doesn't work properly for the blur effect.

This is what I mean, changing orientation in the simulator with slow animation set to on (look at whats happens in the bottom of the view): https://www.dropbox.com/s/bgtx8ygdawkx8be/BlurProblem.mov?dl=0

I have tried setting different content modes and resetting the auto-resizing value, but nothing seems to help.

How can I get the UIVisualEffectView to resize correctly?

1

There are 1 answers

0
heikomania On

Try and set the frame in your viewDidLayoutSubviewsmethod. That way your frame gets set after your view is in place.