diff --git a/CarouselView.Maui/Abstractions/CarouselViewControl.cs b/CarouselView.Maui/Abstractions/CarouselViewControl.cs index 5b3cdcc..6be96c1 100644 --- a/CarouselView.Maui/Abstractions/CarouselViewControl.cs +++ b/CarouselView.Maui/Abstractions/CarouselViewControl.cs @@ -115,6 +115,14 @@ public int AutoplayInterval set { SetValue(AutoplayIntervalProperty, value); } } + public static readonly BindableProperty IgnoreSafeAreaProperty = BindableProperty.Create("IgnoreSafeArea", typeof(bool), typeof(CarouselViewControl), true); + + public bool IgnoreSafeArea + { + get { return (bool)GetValue(IgnoreSafeAreaProperty); } + set { SetValue(IgnoreSafeAreaProperty, value); } + } + #region Indicators public static readonly BindableProperty IndicatorsTintColorProperty = BindableProperty.Create("IndicatorsTintColor", typeof(Color), typeof(CarouselViewControl), Colors.Silver); diff --git a/CarouselView.Maui/Platforms/iOS/CarouselViewRenderer.cs b/CarouselView.Maui/Platforms/iOS/CarouselViewRenderer.cs index f4f3a25..1553103 100644 --- a/CarouselView.Maui/Platforms/iOS/CarouselViewRenderer.cs +++ b/CarouselView.Maui/Platforms/iOS/CarouselViewRenderer.cs @@ -66,7 +66,7 @@ public override void LayoutSubviews() //Reset safeAreaInsets to UIEdgeInsets.Zero if (pageController == null || pageController.View == null) { return; } var safeAreaInsets = pageController.View.SafeAreaInsets; - if (safeAreaInsets != UIEdgeInsets.Zero) + if (safeAreaInsets != UIEdgeInsets.Zero && Element.IgnoreSafeArea) { pageController.AdditionalSafeAreaInsets = new UIEdgeInsets(-safeAreaInsets.Top, -safeAreaInsets.Left, -safeAreaInsets.Bottom, -safeAreaInsets.Right); } @@ -1428,4 +1428,4 @@ protected override void Dispose(bool disposing) return true; } } -} \ No newline at end of file +}