Skip to content
Draft
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue33241.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.Maui.Controls.Shapes;
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 33241, "StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background", PlatformAffected.iOS | PlatformAffected.macOS)]
public class Issue33241 : ContentPage
{
public Issue33241()
{
var layout =
new Border
{
Background = Colors.SkyBlue,
Padding = 10,
Content =
new Issue33241_CustomView
{
Background = Colors.Red,
AutomationId = "CustomView",
Padding = 10
}
};
Content = layout;
}
}

public class Issue33241_CustomView : StackLayout
{
protected override void OnSizeAllocated(double width, double height)
{
this.Clip = new RoundRectangleGeometry { Rect = new Rect(0, 0, width, height) };
base.OnSizeAllocated(width, height);
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

public class Issue33241 : _IssuesUITest
{
public Issue33241(TestDevice testDevice) : base(testDevice)
{
}

public override string Issue => "StackLayout fails to render content while applying Clip, and the layout is placed inside a Border with Background";

[Test]
[Category(UITestCategories.Border)]
public void Issue33241Test()
{
App.WaitForElement("CustomView");
VerifyScreenshot();
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion src/Core/src/Platform/iOS/WrapperView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ public override void LayoutSubviews()
return;

if (_borderView is not null)
{
BringSubviewToFront(_borderView);
}
else
{
this.Superview?.BringSubviewToFront(this);
}

var child = subviews[0];

child.Frame = Bounds;

if (MaskLayer is not null)
Expand Down
Loading