Closed cyndibaby905 closed 11 years ago
Did you start in portrait and reorient or start in landscape?
@rnystrom Yes, I started in portrait and reorient to landscpe. Then I opened the RNBlurModalView
but it's not center aligned.
I debugged the code, the root cause of this issue is - [UIView frame]
hasn't been updated when performing the method - [RNBlurModalView delayedShow]
. When constructing the RNBlurModalView
object, its frame
depends on its parentView
's frame
. However, we didn't add it to its parentView
immediately but deferred a moment then did an animation to add. At that moment, the frame
of parentView
may changed, that's why the BNBlurModalView
didn't get center aligned.
My solution is whenever BNBlurModalView
being added to a parentView, the code will update its frame
according to parentView's frame
, then perform the rest logic.
Or to better arrange the logic, my suggestion is when constructing the RNBlurModalView
, we add it to its parentView immediately but set its property isHidden
to YES
, then defer a moment to do the animation. The frame
of RNBlurModalView
will automatically update according to its autoresizingMask
, so it's safer.
I just committed my code to fix this issue and opened a pull request, it's in #9 , you could take a look, thanks!
Hopefully fixed with your Pull Request. Thanks for that!
Tested it in iOS 6 and iOS 5, the
RNBlurModalView
is not center aligned when in landscape.