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