2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
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
Note: DrawView event is used to pass the custom view into your carousel view. It holds the following arguments
The following code example illustrates the way to use the UI Virtualization feature on carousel control.
In ViewDidLoad:
C#public override void ViewDidLoad() { base.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; carouselView.AddSubview(iconLabel); e.View = carouselView; }; View.AddSubview(sFCarousel); // Perform any additional setup after loading the view, typically from a nib. }
Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/VirtualizationSampleiOS-1741614459
|
2X faster development
The ultimate Xamarin UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.