[英]NIPhotoAlbumScrollView: unable to adjust image after device rotation
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? 我正在使用Nimbus框架中的 NIPhotoAlbumScrollView ,并且一旦旋转设备,显示的图像就会失去其中心位置...有人使用了此组件并遇到了相同的情况吗?
ps: I'm using (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight) mask for both NIPhotoAlbumScrollView and its NIPagingScrollViewPage ps:我正在为NIPhotoAlbumScrollView及其NIPagingScrollViewPage使用(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)蒙版
Call these methods of your NIPhotoAlbumScrollView in corresponding view controller methods 在相应的视图控制器方法中调用NIPhotoAlbumScrollView的这些方法
- 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 文档http://latest.docs.nimbuskit.info/interface_n_i_paging_scroll_view.html#a3cd8024a82d09f24019ea916551904c4
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.