Handle error when splash image is missing.
From pull request: https://github.com/apache/cordova-plugin-splashscreen/pull/1
This commit is contained in:
parent
9541c1eb37
commit
d799eda020
@ -163,7 +163,7 @@
|
|||||||
- (void)updateBounds
|
- (void)updateBounds
|
||||||
{
|
{
|
||||||
UIImage* img = _imageView.image;
|
UIImage* img = _imageView.image;
|
||||||
CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height);
|
CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero;
|
||||||
|
|
||||||
CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
|
CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
|
||||||
|
|
||||||
@ -172,8 +172,8 @@
|
|||||||
CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
|
CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
|
||||||
if (!(IsAtLeastiOSVersion(@"7.0"))) {
|
if (!(IsAtLeastiOSVersion(@"7.0"))) {
|
||||||
imgBounds.origin.y -= statusFrame.size.height;
|
imgBounds.origin.y -= statusFrame.size.height;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (imgBounds.size.width > 0) {
|
||||||
CGRect viewBounds = self.viewController.view.bounds;
|
CGRect viewBounds = self.viewController.view.bounds;
|
||||||
CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
|
CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
|
||||||
CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
|
CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user