Browse Source

Fix top bar buttons size on iOS 10 (#4783)

Fix top bar buttons size on iOS 10

Fixes #4759
Yogev Ben David 5 years ago
parent
commit
8282d934f7
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      lib/ios/RNNUIBarButtonItem.m

+ 2
- 0
lib/ios/RNNUIBarButtonItem.m View File

@@ -16,6 +16,7 @@
16 16
 	UIButton* button = [[UIButton alloc] init];
17 17
 	[button addTarget:self action:@selector(onButtonPressed) forControlEvents:UIControlEventTouchUpInside];
18 18
 	[button setImage:iconImage forState:UIControlStateNormal];
19
+	[button setFrame:CGRectMake(0, 0, iconImage.size.width, iconImage.size.height)];
19 20
 	self = [super initWithCustomView:button];
20 21
 	self.buttonId = buttonId;
21 22
 	return self;
@@ -62,6 +63,7 @@
62 63
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
63 64
 	self.widthConstraint.constant = rootView.intrinsicContentSize.width;
64 65
 	self.heightConstraint.constant = rootView.intrinsicContentSize.height;
66
+	[rootView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
65 67
 	[rootView setNeedsUpdateConstraints];
66 68
 	[rootView updateConstraintsIfNeeded];
67 69
 }