Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ internal UIContainerCell(string cellId, View view, Shell shell, object context)
var platformView = view.ToPlatform();
ContentView.AddSubview(platformView);
platformView.AccessibilityTraits |= UIAccessibilityTrait.Button;
platformView.TranslatesAutoresizingMaskIntoConstraints = false;

var margin = view.Margin;
var constraints = new NSLayoutConstraint[]
{
platformView.LeadingAnchor.ConstraintEqualTo(ContentView.LeadingAnchor, (nfloat)margin.Left),
platformView.TrailingAnchor.ConstraintEqualTo(ContentView.TrailingAnchor, (nfloat)(-margin.Right)),
platformView.TopAnchor.ConstraintEqualTo(ContentView.TopAnchor, (nfloat)margin.Top),
platformView.BottomAnchor.ConstraintEqualTo(ContentView.BottomAnchor, (nfloat)(-margin.Bottom))
};
NSLayoutConstraint.ActivateConstraints(constraints);

_renderer.PlatformView.ClipsToBounds = true;
ContentView.ClipsToBounds = true;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue15154.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
namespace Maui.Controls.Sample.Issues;

[Issue(IssueTracker.Github, 15154, "iOS Flyout title is not broken over multiple lines when you rotate your screen", PlatformAffected.iOS)]
public class Issue15154 : Shell
{
public Issue15154()
{
this.Items.Add(new ShellContent
{
Title = "EmptyView Template with behavior with height",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Template Grid",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Template Grid with behavior with height",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Template Grid with behavior without height",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Text ScrollView",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Template ScrollView",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Text ScrollView with behavior with height",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});

this.Items.Add(new ShellContent
{
Title = "EmptyView Text ScrollView without behavior with height",
ContentTemplate = new DataTemplate(typeof(Issue15154_MainPage))
});
}

public class Issue15154_MainPage : ContentPage
{
public Issue15154_MainPage()
{
var OpenFlyoutButton = new Button
{
Text = "Open Flyout",
AutomationId = "OpenFlyoutButton"
};

OpenFlyoutButton.Clicked += (sender, args) => Shell.Current.FlyoutIsPresented = true;
Content = new StackLayout()
{
Children = { OpenFlyoutButton }
};
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms iOS and Android.
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

namespace Microsoft.Maui.TestCases.Tests.Issues;

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

public override string Issue => "iOS Flyout title is not broken over multiple lines when you rotate your screen";

[Test]
[Category(UITestCategories.Shell)]
public void ShouldFlyoutTextWrapsInLandscape()
{
App.WaitForElement("OpenFlyoutButton");
App.Tap("OpenFlyoutButton");
App.SetOrientationLandscape();
VerifyScreenshot();
}
}
#endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading