forked from github/Toast-PhoneGap-Plugin
#37 Support landscape mode on iOS 7
This commit is contained in:
parent
3d0b2927ae
commit
50290d83de
@ -2,7 +2,7 @@
|
|||||||
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
id="nl.x-services.plugins.toast"
|
id="nl.x-services.plugins.toast"
|
||||||
version="2.1.0">
|
version="2.1.1">
|
||||||
|
|
||||||
<name>Toast</name>
|
<name>Toast</name>
|
||||||
|
|
||||||
|
@ -114,8 +114,13 @@ static UIView *prevToast = NULL;
|
|||||||
toast.exclusiveTouch = YES;
|
toast.exclusiveTouch = YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure that if InAppBrowser is active, we're still showing Toasts on top of it
|
if ([[[UIDevice currentDevice] systemVersion] compare:@"8.0" options:NSNumericSearch] != NSOrderedAscending) {
|
||||||
|
// on iOS8 when InAppBrowser is active, the Toast is below it,
|
||||||
[self.superview.superview addSubview:toast];
|
[self.superview.superview addSubview:toast];
|
||||||
|
} else {
|
||||||
|
// ..on iOS7 however with this fix on landscape the Toast isn't rotated automatically
|
||||||
|
[self.superview addSubview:toast];
|
||||||
|
}
|
||||||
|
|
||||||
[UIView animateWithDuration:CSToastFadeDuration
|
[UIView animateWithDuration:CSToastFadeDuration
|
||||||
delay:0.0
|
delay:0.0
|
||||||
@ -247,7 +252,10 @@ static UIView *prevToast = NULL;
|
|||||||
return CGSizeMake(ceilf(boundingRect.size.width), ceilf(boundingRect.size.height));
|
return CGSizeMake(ceilf(boundingRect.size.width), ceilf(boundingRect.size.height));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||||
return [string sizeWithFont:font constrainedToSize:constrainedSize lineBreakMode:lineBreakMode];
|
return [string sizeWithFont:font constrainedToSize:constrainedSize lineBreakMode:lineBreakMode];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIView *)viewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image {
|
- (UIView *)viewForMessage:(NSString *)message title:(NSString *)title image:(UIImage *)image {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user