How to set gap between unselected items in .NET MAUI Carousel?
This section explains how to set the gap between unselected items in a .NET MAUI Carousel. This can be achieved using the Offset property, which adds space between each item in the default ViewMode.
XAML:
<ContentPage.Content>
<carousel:SfCarousel
x:Name="Carousel"
ItemHeight="300"
ItemWidth="200"
ItemsSource="{Binding ImageCollection}"
Offset="10"
ViewMode="Default"/>
</ContentPage.Content>
C#:
SfCarousel carousel = new SfCarousel()
{
ItemWidth = 200,
ItemHeight = 300,
Offset = 10,
ViewMode = default,
};
carousel.SetBinding(SfCarousel.ItemsSourceProperty, "ImageCollection");
Output:
Conclusion
I hope you enjoyed learning how to set the gap between unselected items in the .NET MAUI Carousel.
You can refer to our .NET MAUI Carousel feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Carousel documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components on the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to explore our .NET MAUI Carousel and other .NET MAUI components.
Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal, or the feedback portal. We are always happy to assist you!