Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top