cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-13396) Splash screen images are resized incorrectly on iPhone X
Date Tue, 02 Oct 2018 20:57:00 GMT

    [ https://issues.apache.org/jira/browse/CB-13396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636108#comment-16636108
] 

ASF GitHub Bot commented on CB-13396:
-------------------------------------

kenmickles closed pull request #135: CB-13396: (ios) Fix image sizing on iPhone X
URL: https://github.com/apache/cordova-plugin-splashscreen/pull/135
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index ab97055a..fdab6ee3 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -352,7 +352,15 @@ - (void)updateBounds
     if ([self isUsingCDVLaunchScreen]) {
         // CB-9762's launch screen expects the image to fill the screen and be scaled using
AspectFill.
         CGSize viewportSize = [UIApplication sharedApplication].delegate.window.bounds.size;
-        _imageView.frame = CGRectMake(0, 0, viewportSize.width, viewportSize.height);
+        CGFloat imageHeight = viewportSize.height;
+        
+        // make LaunchStoryboard bottom space constraint work with iOS 11 safe areas
+        if (@available(iOS 11.0, *)) {
+            UIEdgeInsets safeAreaInsets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;
+            imageHeight -= safeAreaInsets.bottom;
+        }
+        
+        _imageView.frame = CGRectMake(0, 0, viewportSize.width, imageHeight);
         _imageView.contentMode = UIViewContentModeScaleAspectFill;
         return; 
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Splash screen images are resized incorrectly on iPhone X
> --------------------------------------------------------
>
>                 Key: CB-13396
>                 URL: https://issues.apache.org/jira/browse/CB-13396
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-splashscreen
>         Environment: iOS 11 / iPhone X
>            Reporter: Ken Mickles
>            Priority: Major
>              Labels: splashscreen
>
> CDVSplashScreen-updateBounds doesn't take iOS11's new safeAreaInsets into account, causing
the image size to change when CDVLaunchScreen.storyboard transitions to the CDVSplashScreen
image.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message