From 5d8e87c966f352676e12ce2d61c75fb22430b123 Mon Sep 17 00:00:00 2001 From: entdark Date: Tue, 10 Dec 2019 02:07:21 +0300 Subject: [PATCH] iOS: fixed incorrect iPhone X detection --- src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs b/src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs index 57e0c951..8a9d5d42 100644 --- a/src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs +++ b/src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs @@ -13,7 +13,10 @@ public static class DeviceInfo public static bool Is_iPhone5 = Device.IsPhone && ScreenMaxLength == 568.0f; public static bool Is_iPhone6 = Device.IsPhone && ScreenMaxLength == 667.0f; public static bool Is_iPhone6Plus = Device.IsPhone && ScreenMaxLength == 736.0f; - public static bool Is_iPhoneX = Device.IsPhone && ScreenMaxLength == 812.0f; + public static bool Is_iPhoneX = Device.IsPhone + && UIDevice.CurrentDevice.CheckSystemVersion(11, 0) + && (UIApplication.SharedApplication?.Delegate?.GetWindow()?.SafeAreaInsets.Top is nfloat top) + && top > 24.0f; } }