I use iCarousel in my objective-c application. When I run the application, the iCarousel items have no space between them even if the view where I put the iCarousel has trailing and leading space with the main view of the UIViewController.
Any help please?
Quoting from https://github.com/nicklockwood/iCarousel
iCarouselOptionSpacing
The spacing between item views. This value is multiplied by the item width (or height, if the carousel is vertical) to get the total space between each item, so a value of 1.0 (the default) means no space between views (unless the views already include padding, as they do in many of the example projects).
How to integrate:
- (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value
{
CGFloat result;
switch(option)
{
case iCarouselOptionSpacing:
result = 1.1f; // If the width of your items is 40 e.g, the spacing would be 4 px.
break;
default:
result = value;
break;
}
return result;
}
Since it's a delegation method, do not forget to set delegate of the iCarousel instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With