iphone - NIPhotoAlbumScrollView : unable to adjust image after device rotation

标签 iphone objective-c ios nimbus-ios

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

ps:我正在为NIPhotoAlbumScrollView及其NIPagingScrollViewPage使用(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)掩码

最佳答案

在相应的 View Controller 方法中调用 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

关于iphone - NIPhotoAlbumScrollView : unable to adjust image after device rotation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9242780/

相关文章:

iphone - iOS开发者有没有 'themes'?

iphone - 协议(protocol)链

ios背景白色渐变

iphone - 图片名称错误?

iphone - (Quickblox) 从应用程序中的任何位置接收视频通话

iphone - SSO 登录对话框返回到 fbDidNotLogin,没有错误指示

ios - 唯一标识两个不同的 View

objective-c - 从 NSCollectionView 拖到 NSOutlineView

iphone - iOS : cannot delete file

ios - 获取 iPhone 所在的国家(没有 CLLocationManager)