SfCarousel with a full screen current item

Hello,

 I'm interested in using SfCarousel similarly to how it was described in a post I found for Xamarin: https://www.syncfusion.com/forums/144047/sfcarousel-with-a-full-screen-current-item 

Specifically, I want to display a single page in full screen and use SfCarousel animations during swipes to load the content of the next page for the user. 

I tried modifying the GitHub example:

https://github.com/SyncfusionExamples/Getting-Started-with-.NET-MAUI-SfCarousel 

Changing it similarly to the sample attached to the Xamarin post. I did my best to make the image of the current item full screen. 

Could you please advise if there is anything I'm missing? 

I'm attaching the MainPage file.


Attachment: MainPage_7450e5b8.zip

3 Replies

AA Aarthi Arjunan Syncfusion Team December 2, 2024 01:03 PM UTC

Hi Beniamin Adam,


Thank you for reaching out to us. We have reviewed your query and prepared a sample to meet your requirement of displaying the current item of the SfCarousel with screen size by setting the ItemHeight and ItemWidth properties. Please refer to the attached sample and the code snippets below for more details.


public MainPage()

{

    InitializeComponent();

 

    carousel.ItemHeight = (int)(DeviceDisplay.MainDisplayInfo.Height / DeviceDisplay.MainDisplayInfo.Density);

    carousel.ItemWidth = (int)(DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density);

}



Please let us know whether the provided suggestion helps to resolve your query. Please don’t hesitate to contact us if you have any concerns or queries.


Regards,

Aarthi A.


Attachment: CarouselSample_ab9dac32.zip


BA Beniamin Adam December 2, 2024 09:14 PM UTC

Hi thanks for a suggestion. And for example. It works perfectly on android but I think on windows it will struggle because the window can be resized. Anyway its good enough for me



PR Preethi Rajakandham Syncfusion Team December 3, 2024 04:30 AM UTC

Hi Beniamin,

Thank you for the update. Please let us know if you require any further assistance. We would be happy to help you.

Regards,

Preethi R



Loader.
Up arrow icon