Skip to content

[iOS/Mac] Fixed the Border Rendering issues in CollectionViewHandler2#27801

Merged
PureWeen merged 7 commits intodotnet:inflight/currentfrom
Ahamed-Ali:fix-27608
Aug 15, 2025
Merged

[iOS/Mac] Fixed the Border Rendering issues in CollectionViewHandler2#27801
PureWeen merged 7 commits intodotnet:inflight/currentfrom
Ahamed-Ali:fix-27608

Conversation

@Ahamed-Ali
Copy link
Copy Markdown
Contributor

@Ahamed-Ali Ahamed-Ali commented Feb 14, 2025

Root Cause of the issue

  • The Virtual View is not arranged in TemplatedCell2, causing some items to render improperly while scrolling in cv2.

Description of Change

  • Properly arranged the Virtual View prevents border shape deformation during scrolling and ensures correct rendering in cv2.

Same Changes of PR merged into Main

#28225 Since the same changes in this PR were already merged into the main branch in LayoutSubviews, I have kept only the test.

Issues Fixed

Fixes #27608

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Polygon

Before Issue Fix After Issue Fix
PolygonIssue.mov
Polygonfixed.mov

RoundRectangle

Before Issue Fix After Issue Fix
RoundRectangleIssue.mov
RoundRectangleFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Feb 14, 2025
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Hey there @Ahamed-Ali! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Feb 14, 2025
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.Handlers.Compatibility;
using Microsoft.Maui.Controls.Handlers.Items;
using Microsoft.Maui.Controls.Handlers.Items2;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The build is facing:

D:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.cs(13,40): error CS0234: The type or namespace name 'Items2' does not exist in the namespace 'Microsoft.Maui.Controls.Handlers' (are you missing an assembly reference?) [D:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.20348.0]
D:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.cs(13,40): error CS0234: The type or namespace name 'Items2' does not exist in the namespace 'Microsoft.Maui.Controls.Handlers' (are you missing an assembly reference?) [D:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-windows10.0.19041.0]
D:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.cs(13,40): error CS0234: The type or namespace name 'Items2' does not exist in the namespace 'Microsoft.Maui.Controls.Handlers' (are you missing an assembly reference?) [D:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-android]
    9023 Warning(s)
    3 Error(s)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Due to Microsoft.Maui.Controls.Handlers.Items2 not being available for Android and Windows, a build error occurred. I have now added a condition to resolve it. Could you please check? @jsuarezruiz

@jsuarezruiz
Copy link
Copy Markdown
Contributor

jsuarezruiz commented Feb 17, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label Feb 17, 2025
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review March 18, 2025 04:49
@Ahamed-Ali Ahamed-Ali requested a review from a team as a code owner March 18, 2025 04:49
@jsuarezruiz
Copy link
Copy Markdown
Contributor

/rebase

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

@Ahamed-Ali Could you rebase and fix the conflict? Thanks in advance.

@Ahamed-Ali
Copy link
Copy Markdown
Contributor Author

Since the same changes in this PR were already merged into the main branch in LayoutSubViews by this #28225, I have kept only the test. @PureWeen / @rmarinho / @jsuarezruiz

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.SetNeedsLayout() -> void
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void
override Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer<TElement>.MovedToWindow() -> void No newline at end of file
override Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer<TElement>.MovedToWindow() -> void
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can revert this unnecessary change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not a change. The same code is only appearing as a change in this PR. When I removed the unshipped code of my fix, this appeared in the PR, and I am unable to remove it. @jsuarezruiz

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/rebase

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Could you fix the build errors?

C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.iOS.cs(19,7): error CS0105: The using directive for 'Microsoft.Maui.Handlers' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-ios]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.iOS.cs(19,7): error CS0105: The using directive for 'Microsoft.Maui.Handlers' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-maccatalyst]
    2 Error(s)

@Ahamed-Ali
Copy link
Copy Markdown
Contributor Author

Could you fix the build errors?

C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.iOS.cs(19,7): error CS0105: The using directive for 'Microsoft.Maui.Handlers' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-ios]
C:\a\_work\1\s\src\Controls\tests\DeviceTests\Elements\CollectionView\CollectionViewTests.iOS.cs(19,7): error CS0105: The using directive for 'Microsoft.Maui.Handlers' appeared previously in this namespace [C:\a\_work\1\s\src\Controls\tests\DeviceTests\Controls.DeviceTests.csproj::TargetFramework=net9.0-maccatalyst]
    2 Error(s)

The build errors occurred because the same namespace was used twice. I have now resolved the errors. @jsuarezruiz

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.SetNeedsLayout() -> void
*REMOVED*override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void
override Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer<TElement>.MovedToWindow() -> void No newline at end of file
override Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer<TElement>.MovedToWindow() -> void
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This change is no longer necessary, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not a change. The same code is only appearing as a change in this PR. When I removed the unshipped code of my fix, this appeared in the PR, and I am unable to remove it. @jsuarezruiz

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mattleibow
Copy link
Copy Markdown
Member

/rebase

@PureWeen PureWeen changed the base branch from main to inflight/current August 15, 2025 23:24
@PureWeen PureWeen merged commit 683bde3 into dotnet:inflight/current Aug 15, 2025
1 check passed
github-actions bot pushed a commit that referenced this pull request Aug 15, 2025
…#27801)

* Fixed the Border Rendering issues in CollectionViewHandler2

* Remove the unwanted namspace

* Removed UI test and added the device test

* Resolved the build errors

* Registered the cv2 handler inside the test to avoid other test failures

* Added a Assert.NotNull test

* Resolved the conflicts
github-actions bot pushed a commit that referenced this pull request Aug 19, 2025
…#27801)

* Fixed the Border Rendering issues in CollectionViewHandler2

* Remove the unwanted namspace

* Removed UI test and added the device test

* Resolved the build errors

* Registered the cv2 handler inside the test to avoid other test failures

* Added a Assert.NotNull test

* Resolved the conflicts
github-actions bot pushed a commit that referenced this pull request Aug 22, 2025
…#27801)

* Fixed the Border Rendering issues in CollectionViewHandler2

* Remove the unwanted namspace

* Removed UI test and added the device test

* Resolved the build errors

* Registered the cv2 handler inside the test to avoid other test failures

* Added a Assert.NotNull test

* Resolved the conflicts
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView collectionview-cv2 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Items' shapes are sometimes rendered incorrectly using CollectionView2Handler

7 participants