Browse Source

Hides react view button until view size calculated

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

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

34
 	reactView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
34
 	reactView.sizeFlexibility = RCTRootViewSizeFlexibilityWidthAndHeight;
35
 	reactView.delegate = self;
35
 	reactView.delegate = self;
36
 	reactView.backgroundColor = [UIColor clearColor];
36
 	reactView.backgroundColor = [UIColor clearColor];
37
-	reactView.clipsToBounds = YES;
37
+	reactView.hidden = YES;
38
 	
38
 	
39
 	self.widthConstraint = [NSLayoutConstraint constraintWithItem:reactView
39
 	self.widthConstraint = [NSLayoutConstraint constraintWithItem:reactView
40
 														attribute:NSLayoutAttributeWidth
40
 														attribute:NSLayoutAttributeWidth
63
 }
63
 }
64
 
64
 
65
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
65
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
66
+	rootView.hidden = NO;
66
 	self.widthConstraint.constant = rootView.intrinsicContentSize.width;
67
 	self.widthConstraint.constant = rootView.intrinsicContentSize.width;
67
 	self.heightConstraint.constant = rootView.intrinsicContentSize.height;
68
 	self.heightConstraint.constant = rootView.intrinsicContentSize.height;
68
 	[rootView setNeedsUpdateConstraints];
69
 	[rootView setNeedsUpdateConstraints];