diff --git a/ios/RNSScreen.m b/ios/RNSScreen.m index c7d8adcf..ac54f181 100644 --- a/ios/RNSScreen.m +++ b/ios/RNSScreen.m @@ -8,33 +8,6 @@ #import #import -@interface RNSScreenFrameData : NSObject -@property (nonatomic, readonly) CGFloat rightInset; -@property (nonatomic, readonly) CGFloat topInset; -@property (nonatomic, readonly) CGFloat bottomInset; -@property (nonatomic, readonly) CGFloat leftInset; -@property (nonatomic, readonly) CGFloat navbarOffset; - -- (instancetype)initWithInsets:(UIEdgeInsets)insets; - -@end - -@implementation RNSScreenFrameData - -- (instancetype)initWithInsets:(UIEdgeInsets)insets andNavbarOffset:(CGFloat)navbarOffset -{ - if (self = [super init]) { - _topInset = insets.top; - _bottomInset = insets.bottom; - _leftInset = insets.left; - _rightInset = insets.right; - _navbarOffset = navbarOffset; - } - return self; -} - -@end - @interface RNSScreenView () @end diff --git a/ios/RNSScreenContainer.m b/ios/RNSScreenContainer.m index 5f20bf64..bdf1f818 100644 --- a/ios/RNSScreenContainer.m +++ b/ios/RNSScreenContainer.m @@ -54,6 +54,7 @@ { subview.reactSuperview = self; [_reactSubviews insertObject:subview atIndex:atIndex]; + subview.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); } - (void)removeReactSubview:(RNSScreenView *)subview @@ -159,6 +160,10 @@ [super layoutSubviews]; [self reactAddControllerToClosestParent:_controller]; _controller.view.frame = self.bounds; + for (RNSScreenView *subview in _reactSubviews) { + subview.frame = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height); + [subview setNeedsLayout]; + } } @end