We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UIVirtualization support to handle the numerous data in carousel

Platform: Xamarin.iOS |
Control: SfCarousel |
Published Date: June 29, 2018 |
Last Revised Date: June 21, 2019


Carousel control can handle the numerous data using UI virtualization by maintaining only the view port items into it.



Properties are used to achieve UI Virtualization options



Data Type

Default Value






Enable or disable UI Virtualization options in carousel control




To load the collection of data’s



DrawView event is used to pass the custom view into your carousel view. It holds the following arguments



  1. Index – Gets the indexed of carousel item.
  2. View – Gets and Sets the custom view of carousel’s item.
  3. Item – Gets the indexed carousel item.


The following code example illustrates the way to use the UI Virtualization feature on carousel control.









In ViewDidLoad:



  public override void ViewDidLoad()
            SFCarousel sFCarousel = new SFCarousel();
            sFCarousel.Frame = new CoreGraphics.CGRect(0, 150, 400, 400);
            ObservableCollection<string> list = new ObservableCollection<string>();
            for (int i = 1; i < 100000; i++)
                list.Add("Item " + i.ToString());
            sFCarousel.ItemWidth = 150;
            sFCarousel.ItemHeight = 150;
            sFCarousel.EnableVirtualization = true;
            sFCarousel.ViewMode = SFCarouselViewMode.SFCarouselViewModeLinear;
            sFCarousel.ItemsSource = list;
            sFCarousel.DrawView+=(object sender, DrawViewEventArgs e) => 
                UIView carouselView = new UIView();
                carouselView.BackgroundColor = UIColor.Red;
                carouselView.Frame = new CoreGraphics.CGRect(0, 0, 150, 150);
                UILabel iconLabel = new UILabel();
                iconLabel.Frame = new CoreGraphics.CGRect(35, 30, 80, 80);
                iconLabel.Text = (sFCarousel.ItemsSource as ObservableCollection<string>)[e.Index];
                iconLabel.TextColor = UIColor.White;
                iconLabel.TextAlignment = UITextAlignment.Center;
                e.View = carouselView;
            // Perform any additional setup after loading the view, typically from a nib.






2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile