Browse Source

flaky navBarCustomView on iOS 10 fix

yogevbd 6 years ago
parent
commit
e709e0e732
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      ios/RCCCustomTitleView.m

+ 2
- 2
ios/RCCCustomTitleView.m View File

26
         
26
         
27
         self.backgroundColor = [UIColor clearColor];
27
         self.backgroundColor = [UIColor clearColor];
28
         self.subView.backgroundColor = [UIColor clearColor];
28
         self.subView.backgroundColor = [UIColor clearColor];
29
-        
29
+                
30
         if ([alignment isEqualToString:@"fill"]) {
30
         if ([alignment isEqualToString:@"fill"]) {
31
             self.frame = frame;
31
             self.frame = frame;
32
             subView.sizeFlexibility = RCTRootViewSizeFlexibilityNone;
32
             subView.sizeFlexibility = RCTRootViewSizeFlexibilityNone;
54
 
54
 
55
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
55
 - (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView {
56
     if ([self.alignment isEqualToString:@"center"]) {
56
     if ([self.alignment isEqualToString:@"center"]) {
57
-        [self setFrame:CGRectMake(self.frame.origin.x, self.frame.origin.y, self.subView.intrinsicContentSize.width, self.subView.intrinsicContentSize.height)];
57
+        [self setFrame:CGRectMake(self.frame.origin.x - rootView.intrinsicContentSize.width / 2, self.frame.origin.y - rootView.intrinsicContentSize.height / 2, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
58
         [self.subView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
58
         [self.subView setFrame:CGRectMake(0, 0, rootView.intrinsicContentSize.width, rootView.intrinsicContentSize.height)];
59
     }
59
     }
60
 }
60
 }