Browse Source

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

Fix top bar buttons size on iOS 10

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