NIPhotoAlbumScrollView:设备旋转后无法调整图像

时间:2012-02-11 18:22:33

标签: iphone objective-c ios nimbus-ios

我正在使用Nimbus framework中的 NIPhotoAlbumScrollView 一旦我旋转设备,显示的图像失去了它的中心位置...有人使用这个组件并面对我同样的情况吗?

ps:我正在为 NIPhotoAlbumScrollView 及其 NIPagingScrollViewPage

使用(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)掩码

1 个答案:

答案 0 :(得分:1)

在相应的视图控制器方法中调用NIPhotoAlbumScrollView的这些方法

- willRotateToInterfaceOrientation:duration:
- willAnimateRotationToInterfaceOrientation:duration:

喜欢这个

- (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];
}

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