Skip to content

Commit

Permalink
Added method for moving close button
Browse files Browse the repository at this point in the history
This method should be called when custom view inside RNBlurModalView
gets resized or moved with argument - point of the new top left corner,
in order to keep the close button where it should be.
  • Loading branch information
svachmic committed May 13, 2014
1 parent ddbdd9e commit 60c94b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RNBlurModalView.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ extern NSString * const kRNBlurDidHidewNotification;
- (void)hide;
- (void)hideWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options completion:(void (^)(void))completion;

-(void)hideCloseButton:(BOOL)hide;
- (void)moveCloseButton:(CGPoint)point;
- (void)hideCloseButton:(BOOL)hide;


@end
6 changes: 5 additions & 1 deletion RNBlurModalView.m
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,11 @@ - (void)hideWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:(
}
}

-(void)hideCloseButton:(BOOL)hide {
- (void)moveCloseButton:(CGPoint)point {
_dismissButton.frame = CGRectMake(point.x, point.y, _dismissButton.frame.size.width, _dismissButton.frame.size.height);
}

- (void)hideCloseButton:(BOOL)hide {
[_dismissButton setHidden:hide];
}

Expand Down

0 comments on commit 60c94b4

Please sign in to comment.