Browse Source

Fixed LightBox not updating overlay width/height on rotate (#1461)

* Fixed LightBox not updating overlay width/height on rotate

* Cleaned up bounds

* Removed unneeded call
Brendon Sled 7 years ago
parent
commit
54d2531720
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      ios/RCCLightBox.m

+ 6
- 1
ios/RCCLightBox.m View File

@@ -48,7 +48,7 @@ const NSInteger kLightBoxTag = 0x101010;
48 48
                 UIColor *backgroundColor = [RCTConvert UIColor:style[@"backgroundColor"]];
49 49
                 if (backgroundColor != nil)
50 50
                 {
51
-                    self.overlayColorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
51
+                    self.overlayColorView = [[UIView alloc] init];
52 52
                     self.overlayColorView.backgroundColor = backgroundColor;
53 53
                     self.overlayColorView.alpha = 0;
54 54
                     [self addSubview:self.overlayColorView];
@@ -87,6 +87,11 @@ const NSInteger kLightBoxTag = 0x101010;
87 87
 -(void)layoutSubviews
88 88
 {
89 89
     [super layoutSubviews];
90
+
91
+    self.reactView.frame = self.bounds;
92
+    if (self.overlayColorView != nil) {
93
+        self.overlayColorView.frame = self.bounds;
94
+    }
90 95
     
91 96
     if(!self.yellowBoxRemoved)
92 97
     {