Skip to content

Commit

Permalink
Fix top bar buttons size on iOS 10 (#4783)
Browse files Browse the repository at this point in the history
Fix top bar buttons size on iOS 10

Fixes #4759
  • Loading branch information
yogevbd authored and guyca committed Feb 26, 2019
1 parent 6065bd1 commit 8282d93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/ios/RNNUIBarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ -(instancetype)init:(NSString*)buttonId withIcon:(UIImage*)iconImage {
UIButton* button = [[UIButton alloc] init];
[button addTarget:self action:@selector(onButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[button setImage:iconImage forState:UIControlStateNormal];
[button setFrame:CGRectMake(0, 0, iconImage.size.width, iconImage.size.height)];
self = [super initWithCustomView:button];
self.buttonId = buttonId;
return self;
Expand Down Expand Up @@ -62,6 +63,7 @@ - (instancetype)init:(NSString*)buttonId withSystemItem:(NSString *)systemItemNa
- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
self.widthConstraint.constant = rootView.intrinsicContentSize.width;
self.heightConstraint.constant = rootView.intrinsicContentSize.height;
[rootView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
[rootView setNeedsUpdateConstraints];
[rootView updateConstraintsIfNeeded];
}
Expand Down

0 comments on commit 8282d93

Please sign in to comment.