Skip to content

Commit

Permalink
feat(itemsrepeater): [iOS] Enable clipping on the ScrollViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr.Rx authored and dr1rrb committed Nov 16, 2020
1 parent e98a417 commit 6a05d31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public partial class ScrollContentPresenter : ContentPresenter, ILayoutConstrain
private void InitializeScrollContentPresenter()
{
this.RegisterParentChangedCallback(this, OnParentChanged);
IFrameworkElementHelper.Initialize(this);
}

private void OnParentChanged(object instance, object key, DependencyObjectParentChangedEventArgs args)
Expand Down
5 changes: 4 additions & 1 deletion src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ScrollViewer.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Windows.UI.Xaml.Controls
{
public partial class ScrollViewer : ContentControl
public partial class ScrollViewer : ContentControl, ICustomClippingElement
{
/// <summary>
/// On iOS 10-, we set a flag on the view controller such that the CommandBar doesn't automatically affect ScrollViewer content
Expand Down Expand Up @@ -160,5 +160,8 @@ public override void WillMoveToSuperview(UIView newsuper)
base.WillMoveToSuperview(newsuper);
UpdateSizeChangedSubscription(isCleanupRequired: newsuper == null);
}

bool ICustomClippingElement.AllowClippingToLayoutSlot => true;
bool ICustomClippingElement.ForceClippingToLayoutSlot => true; // force scrollviewer to always clip
}
}

0 comments on commit 6a05d31

Please sign in to comment.