diff --git a/lib/ios/RNNUIBarButtonItem.m b/lib/ios/RNNUIBarButtonItem.m index 61198c3301f..fec64ee4141 100644 --- a/lib/ios/RNNUIBarButtonItem.m +++ b/lib/ios/RNNUIBarButtonItem.m @@ -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; @@ -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]; }