Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not center aligned issue in landscape mode for both iOS7 and iOS8 #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions RNBlurModalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ + (UIView*)generateModalViewWithTitle:(NSString*)title message:(NSString*)messag

view.height = messageLabel.bottom + padding;

view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin;

return view;
}

Expand Down Expand Up @@ -168,7 +166,7 @@ - (id)initWithViewController:(UIViewController*)viewController view:(UIView*)vie
if (self = [self initWithFrame:CGRectMake(0, 0, viewController.view.width, viewController.view.height)]) {
[self addSubview:view];
_contentView = view;
_contentView.center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
_contentView.center = CGPointMake(CGRectGetMidX(viewController.view.bounds), CGRectGetMidY(viewController.view.bounds));
_controller = viewController;
_parentView = nil;
_contentView.clipsToBounds = YES;
Expand All @@ -193,7 +191,7 @@ - (id)initWithParentView:(UIView*)parentView view:(UIView*)view {
if (self = [self initWithFrame:CGRectMake(0, 0, parentView.width, parentView.height)]) {
[self addSubview:view];
_contentView = view;
_contentView.center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
_contentView.center = CGPointMake(CGRectGetMidX(parentView.bounds), CGRectGetMidY(parentView.bounds));
_controller = nil;
_parentView = parentView;
_contentView.clipsToBounds = YES;
Expand Down