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
                 UIColor *backgroundColor = [RCTConvert UIColor:style[@"backgroundColor"]];
48
                 UIColor *backgroundColor = [RCTConvert UIColor:style[@"backgroundColor"]];
49
                 if (backgroundColor != nil)
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
                     self.overlayColorView.backgroundColor = backgroundColor;
52
                     self.overlayColorView.backgroundColor = backgroundColor;
53
                     self.overlayColorView.alpha = 0;
53
                     self.overlayColorView.alpha = 0;
54
                     [self addSubview:self.overlayColorView];
54
                     [self addSubview:self.overlayColorView];
87
 -(void)layoutSubviews
87
 -(void)layoutSubviews
88
 {
88
 {
89
     [super layoutSubviews];
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
     if(!self.yellowBoxRemoved)
96
     if(!self.yellowBoxRemoved)
92
     {
97
     {