Skip to content

Conversation

@KarthikRajaKalaimani
Copy link
Contributor

@KarthikRajaKalaimani KarthikRajaKalaimani commented Mar 18, 2025

Issue Details:

ShellContent title not rendering in when maximize the window on MacCatalyst

Root Cause:

The issue was caused by a layout rendering problem when the window was maximized. When the window size changed (e.g., when maximized), some items in the UICollectionView were not displayed correctly. This occurred because the collectionview layout was not being invalidated when the size of the collection view changed, leading to improper recalculation of the collection view's item layouts, especially when resizing the window.

Description of Change:

The layout of the collection view is invalidated if there is a change in its bounds (such as size or position). When this occurs, the collection view's layout is recalculated, ensuring that its items are repositioned and arranged according to the new dimensions.

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac

Reference:

N/A

Issues Fixed:

Fixes #26864
Fixes #15057

Screenshots

Before After
399403752-4a58e5a0-4ed9-4a0b-bdd7-20e3d30e1648.mov
Screen.Recording.2025-03-14.at.11.34.40.AM.mov

@dotnet-policy-service dotnet-policy-service bot added community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration labels Mar 18, 2025
@jsuarezruiz jsuarezruiz added platform/macos macOS / Mac Catalyst area-controls-shell Shell Navigation, Routes, Tabs, Flyout labels Mar 18, 2025
public void ShellContentTitleNotRendering()
{
App.WaitForElement("Settings");
App.EnterFullScreen();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are removing some system animations running the UITests on macOS, but still, the change to full screen is not something immediate. Here, we need to wait a little bit.

Copy link
Contributor Author

@KarthikRajaKalaimani KarthikRajaKalaimani Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are removing some system animations running the UITests on macOS, but still, the change to full screen is not something immediate. Here, we need to wait a little bit.

I have added a 500-millisecond delay after switching to full screen. Please let me know if you have any concerns regarding this change.

@@ -0,0 +1,41 @@
namespace Maui.Controls.Sample.Issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-nit: After #28040, you can convert this to file-scope namespace by CTRL+. in Visual Studio (I believe it's the same in VS Code).

If it is converted, then new files will use file-scope namespaces more and more as people IMO copy old files to create new code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-nit: After #28040, you can convert this to file-scope namespace by CTRL+. in Visual Studio (I believe it's the same in VS Code).

If it is converted, then new files will use file-scope namespaces more and more as people IMO copy old files to create new code.

@MartyIX I've made the changes to the file as per your suggestion. Please let me know if you have any concerns regarding this update.

@KarthikRajaKalaimani KarthikRajaKalaimani marked this pull request as ready for review March 19, 2025 04:46
@KarthikRajaKalaimani KarthikRajaKalaimani requested a review from a team as a code owner March 19, 2025 04:46
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

CGRect frame = new CGRect(View.Bounds.X, headerTop, View.Bounds.Width, HeaderHeight);
_blurView.Frame = frame;
_header.ViewController.View.Frame = frame;
#if MACCATALYST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On iOS, it's not necessary, right? If, for example, the device changes orientation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On iOS, it's not necessary, right? If, for example, the device changes orientation.

Yes, On iOS it's not necessary.

var layoutIfNeed = layout.ShouldInvalidateLayoutForBoundsChange(frame);
if (layoutIfNeed)
{
layout.InvalidateLayout();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance-wise, can you check if it is invalidated with each window resize?

@jsuarezruiz
Copy link
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell Content Title Not Rendering in Full-Screen Mode on Mac Catalyst Mac Catalyst loses Shell Content items under Tabs only when maximized

3 participants