-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
When using a LinearItemsLayout with a CarouselView on Android, the ItemSpacing
will reduce the width of the elements in the CarouselView. This works correctly on iOS.
Screenshots
iOS (correct):
Android (incorrect):
Code
<CarouselView
BackgroundColor="Red"
HeightRequest="400"
ItemsSource="{Binding Items}"
WidthRequest="300">
<CarouselView.ItemsLayout>
<LinearItemsLayout
ItemSpacing="50"
Orientation="Horizontal"
SnapPointsAlignment="Center"
SnapPointsType="MandatorySingle" />
</CarouselView.ItemsLayout>
<CarouselView.ItemTemplate>
<DataTemplate x:DataType="{x:Type system:String}">
<Grid
Margin="0"
Padding="0"
BackgroundColor="Yellow">
<Label
FontSize="24"
HorizontalOptions="Center"
Text="{Binding}"
VerticalOptions="Center" />
</Grid>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
Steps to Reproduce
- Create a new MAUI project
- Add a CarouselView
- Add a LinearItemsLayout and set
ItemSpacing = "50"
- Add a collection with some data and bind to it
- Run on Android
- The items get smaller the larger the
ItemSpacing
is
Expected behavior: Item spacing is applied between elements without shrinking their width
Current behavior: Items get shrunk on Android, spacing isn't applied between items
Link to public reproduction project repository
https://github.com/ewerspej/MauiCarouselSpacingBugAndroid
Version with bug
9.0.70 SR7
Is this a regression from previous behavior?
Unknown
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 15 (possibly also earlier)
Did you find any workaround?
No
Relevant log output
N/A
Metadata
Metadata
Assignees
Labels
area-controls-collectionviewCollectionView, CarouselView, IndicatorViewCollectionView, CarouselView, IndicatorViewp/1Work that is important, and has been scheduled for release in this or an upcoming sprintWork that is important, and has been scheduled for release in this or an upcoming sprintpartner/syncfusionIssues / PR's with Syncfusion collaborationIssues / PR's with Syncfusion collaborationplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done