Skip to content

Commit 549a89f

Browse files
committed
Update BorderHandler.iOS.cs
1 parent 8a604e4 commit 549a89f

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

src/Core/src/Handlers/Border/BorderHandler.iOS.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,26 @@ static partial void UpdateContent(IBorderHandler handler)
5454
var platformContent = content.ToPlatform(handler.MauiContext);
5555

5656
// If the content is a UIScrollView, we need a container to handle masks and clip shapes effectively.
57-
if (platformContent is UIScrollView && content.Handler is not null)
57+
if (platformContent is UIScrollView)
5858
{
59-
content.Handler.HasContainer = true;
60-
UpdateContent(handler);
59+
var containerView = new UIView
60+
{
61+
BackgroundColor = UIColor.Clear,
62+
ClipsToBounds = true,
63+
TranslatesAutoresizingMaskIntoConstraints = false
64+
};
65+
66+
platformContent.Tag = ContentView.ContentTag;
67+
containerView.AddSubview(platformContent);
68+
platformView.AddSubview(containerView);
69+
70+
NSLayoutConstraint.ActivateConstraints(
71+
[
72+
containerView.TopAnchor.ConstraintEqualTo(platformView.TopAnchor),
73+
containerView.LeadingAnchor.ConstraintEqualTo(platformView.LeadingAnchor),
74+
containerView.TrailingAnchor.ConstraintEqualTo(platformView.TrailingAnchor),
75+
containerView.BottomAnchor.ConstraintEqualTo(platformView.BottomAnchor)
76+
]);
6177
}
6278
else
6379
{

0 commit comments

Comments
 (0)