Skip to content

Commit

Permalink
Update AcrylicViewHandler.cs
Browse files Browse the repository at this point in the history
It seems that ExtraDark is supported on iOS 10+.  And Maui only supports iOS 11+. So I commented the TryParse line to check if the iOS version is greater than 14.2 and simply returned ExtraDark directly for ExtraDarkEffect Style.
  • Loading branch information
AswinPG committed May 16, 2023
1 parent 65af324 commit 24e5215
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions AcrylicView/Platforms/iOS/AcrylicViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ private static void MapEffectStyle(AcrylicViewHandler handler, IAcrylicView view
return;

var ver = UIDevice.CurrentDevice.SystemVersion;
if (!float.TryParse(ver, out float version))
return;
//if (!float.TryParse(ver, out float version))
// return;


var style = view.EffectStyle switch
{
EffectStyle.Light => UIBlurEffectStyle.Light,
EffectStyle.Dark => UIBlurEffectStyle.Dark,
EffectStyle.ExtraLight => UIBlurEffectStyle.ExtraLight,
EffectStyle.ExtraDark => version >= 14.2 ? UIBlurEffectStyle.ExtraDark : UIBlurEffectStyle.Dark,
EffectStyle.ExtraDark => UIBlurEffectStyle.ExtraDark,
_ => UIBlurEffectStyle.Light
};
handler.acrylicEffectView.Effect = UIBlurEffect.FromStyle(style);
Expand Down

0 comments on commit 24e5215

Please sign in to comment.