diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-01-02 15:42:10 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2018-01-02 15:42:10 -0500 |
commit | 0d9db30139f0e7c4c14803413b9100c2cb33fb5b (patch) | |
tree | 996a778518fdade6ec2d163e967304c63f7f123e | |
parent | 24fd9026007bf8cfe40cdd4c9123d313fc6ba055 (diff) | |
download | sdl_ios-0d9db30139f0e7c4c14803413b9100c2cb33fb5b.tar.gz |
Fix setting a new rootViewController
* Fix setting background color of lock screen
-rwxr-xr-x | SmartDeviceLink/SDLCarWindow.m | 11 | ||||
-rw-r--r-- | SmartDeviceLink/SDLLockScreenViewController.m | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/SmartDeviceLink/SDLCarWindow.m b/SmartDeviceLink/SDLCarWindow.m index 7b096c5f5..3f7873bce 100755 --- a/SmartDeviceLink/SDLCarWindow.m +++ b/SmartDeviceLink/SDLCarWindow.m @@ -115,14 +115,21 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Custom Accessors - (void)setRootViewController:(nullable UIViewController *)rootViewController { - _rootViewController = rootViewController; - if (rootViewController == nil) { + _rootViewController = nil; return; } + NSAssert((rootViewController.supportedInterfaceOrientations == UIInterfaceOrientationMaskPortrait || rootViewController.supportedInterfaceOrientations == UIInterfaceOrientationMaskLandscapeLeft || rootViewController.supportedInterfaceOrientations == UIInterfaceOrientationMaskLandscapeRight), @"SDLCarWindow rootViewController must support only a single interface orientation"); + + if (self.streamManager.screenSize.width != 0) { + rootViewController.view.frame = CGRectMake(0, 0, self.streamManager.screenSize.width, self.streamManager.screenSize.height); + rootViewController.view.bounds = rootViewController.view.frame; + } + + _rootViewController = rootViewController; } #pragma mark - Private Helpers diff --git a/SmartDeviceLink/SDLLockScreenViewController.m b/SmartDeviceLink/SDLLockScreenViewController.m index d399c2a44..291913aaa 100644 --- a/SmartDeviceLink/SDLLockScreenViewController.m +++ b/SmartDeviceLink/SDLLockScreenViewController.m @@ -67,7 +67,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)setBackgroundColor:(UIColor *_Nullable)backgroundColor { _backgroundColor = backgroundColor; - self.view.backgroundColor = _backgroundColor; [self sdl_layoutViews]; } @@ -89,6 +88,8 @@ NS_ASSUME_NONNULL_BEGIN self.lockedLabel.textColor = iconColor; + self.view.backgroundColor = self.backgroundColor; + if (self.vehicleIcon != nil && self.appIcon != nil) { [self sdl_setVehicleAndAppIconsLayout]; } else if (self.vehicleIcon != nil) { |