Browse Source

Fix flickering react view button

yogevbd 5 years ago
parent
commit
77ee4df6c9
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      lib/ios/RNNUIBarButtonItem.m

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

@@ -31,10 +31,11 @@
31 31
 -(instancetype)init:(NSString*)buttonId withCustomView:(RCTRootView *)reactView {
32 32
 	self = [super initWithCustomView:reactView];
33 33
 	
34
-	reactView.hidden = YES;
35 34
 	reactView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
36 35
 	reactView.delegate = self;
37 36
 	reactView.backgroundColor = [UIColor clearColor];
37
+	reactView.clipsToBounds = YES;
38
+	
38 39
 	self.widthConstraint = [NSLayoutConstraint constraintWithItem:reactView
39 40
 														attribute:NSLayoutAttributeWidth
40 41
 														relatedBy:NSLayoutRelationEqual
@@ -62,10 +63,8 @@
62 63
 }
63 64
 
64 65
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
65
-	rootView.hidden = NO;
66 66
 	self.widthConstraint.constant = rootView.intrinsicContentSize.width;
67 67
 	self.heightConstraint.constant = rootView.intrinsicContentSize.height;
68
-	[rootView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
69 68
 	[rootView setNeedsUpdateConstraints];
70 69
 	[rootView updateConstraintsIfNeeded];
71 70
 }