Skip to content

Commit

Permalink
iOS: fixed incorrect iPhone X detection
Browse files Browse the repository at this point in the history
  • Loading branch information
entdark committed Dec 9, 2019
1 parent cc0e9f1 commit 5d8e87c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app-ropio/AppRopio.Base/iOS/UIExtentions/DeviceInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit 5d8e87c

Please sign in to comment.