diff --git a/src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs b/src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs index 0b088d1dfe03..342557e28714 100644 --- a/src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs +++ b/src/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cs @@ -45,7 +45,6 @@ protected override UICollectionViewLayout SelectLayout() NSCollectionLayoutDimension itemHeight = NSCollectionLayoutDimension.CreateFractionalHeight(1); NSCollectionLayoutDimension groupWidth = NSCollectionLayoutDimension.CreateFractionalWidth(1); NSCollectionLayoutDimension groupHeight = NSCollectionLayoutDimension.CreateFractionalHeight(1); - nfloat itemSpacing = 0; var layout = new UICollectionViewCompositionalLayout((sectionIndex, environment) => { @@ -83,7 +82,10 @@ protected override UICollectionViewLayout SelectLayout() // Create our section layout var section = NSCollectionLayoutSection.Create(group: group); - section.InterGroupSpacing = itemSpacing; + if (VirtualView.ItemsLayout is LinearItemsLayout linearItemsLayout) + { + section.InterGroupSpacing = (nfloat)linearItemsLayout.ItemSpacing; + } section.OrthogonalScrollingBehavior = IsHorizontal ? UICollectionLayoutSectionOrthogonalScrollingBehavior.GroupPagingCentered : UICollectionLayoutSectionOrthogonalScrollingBehavior.None; section.VisibleItemsInvalidationHandler = (items, offset, env) => { diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25192.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue25192.xaml index b66157fc115c..f877df00226d 100644 --- a/src/Controls/tests/TestCases.HostApp/Issues/Issue25192.xaml +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25192.xaml @@ -1,27 +1,28 @@  - - + Item1 Item2 Item3 - - + + - - + + - - + + \ No newline at end of file