github.com/nicklockwood/iCarousel - is the carousel component

I have created 2 *.xib files. 1 for Portrait, 1 for Landscape (different sizes).

Now i do this:

- (void)orientationChanged:(NSNotification *)notification{ //On orientation change
    [self numberOfItemsInCarousel:iboCarousel];
    [iboCarousel reloadData];
}

But when i reload items in carousel the distances between items and other things seem to be stretched or something... How to fix it?

Examples in attachments

App loaded in landscape

enter image description here

App loaded in portrait and then switched to landscape

enter image description here

有帮助吗?

解决方案

There's a delegate callback called - (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value, where various layout options (like iCarouselOptionSpacing) are passed and the delegate is asked to return value.

In it, detect the UI orientation and answer conditionally, either the passed default value for portrait or one that you've tweaked for landscape.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top