Pregunta

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

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top