문제

I'm using NIPhotoAlbumScrollView from Nimbus framework and once I rotate the device the image displayed loses its central position... have someone used this component and faced my same situation?

ps: I'm using (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight) mask for both NIPhotoAlbumScrollView and its NIPagingScrollViewPage

도움이 되었습니까?

해결책

Call these methods of your NIPhotoAlbumScrollView in corresponding view controller methods

- willRotateToInterfaceOrientation:duration:
- willAnimateRotationToInterfaceOrientation:duration:

Like this

- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation { return YES; }

    //====================================================================================================
- (void) willRotateToInterfaceOrientation: (UIInterfaceOrientation) toInterfaceOrientation duration: (NSTimeInterval) duration
    {
        [super               willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration];
        [self.photoAlbumView willRotateToInterfaceOrientation: toInterfaceOrientation duration: duration];
    }


//====================================================================================================
- (void) willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation
                                          duration: (NSTimeInterval) duration
{
    [super               willAnimateRotationToInterfaceOrientation: interfaceOrientation duration: duration];
    [self.photoAlbumView willAnimateRotationToInterfaceOrientation: interfaceOrientation duration: duration];
}

Docs http://latest.docs.nimbuskit.info/interface_n_i_paging_scroll_view.html#a3cd8024a82d09f24019ea916551904c4

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top