Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CarouselView.Maui/Abstractions/CarouselViewControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions CarouselView.Maui/Platforms/iOS/CarouselViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -1428,4 +1428,4 @@ protected override void Dispose(bool disposing)
return true;
}
}
}
}