我正在使用 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];
}
关于iphone - NIPhotoAlbumScrollView : unable to adjust image after device rotation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9242780/