diff --git a/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m b/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m index e36cb3ab4c..48c3f33a0c 100644 --- a/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m +++ b/sdk/objc/Framework/Classes/Metal/RTCMTLVideoView.m @@ -91,15 +91,16 @@ _metalView.delegate = self; [self addSubview:_metalView]; _metalView.contentMode = UIViewContentModeScaleAspectFit; - _metalView.translatesAutoresizingMaskIntoConstraints = NO; - UILayoutGuide *margins = self.layoutMarginsGuide; - [_metalView.topAnchor constraintEqualToAnchor:margins.topAnchor].active = YES; - [_metalView.bottomAnchor constraintEqualToAnchor:margins.bottomAnchor].active = YES; - [_metalView.leftAnchor constraintEqualToAnchor:margins.leftAnchor].active = YES; - [_metalView.rightAnchor constraintEqualToAnchor:margins.rightAnchor].active = YES; } } +#pragma mark - Private + +- (void)layoutSubviews { + [super layoutSubviews]; + _metalView.frame = self.bounds; +} + #pragma mark - MTKViewDelegate methods - (void)drawInMTKView:(nonnull MTKView *)view {