[英]NIPhotoAlbumScrollView: unable to adjust image after device rotation
我正在使用Nimbus框架中的 NIPhotoAlbumScrollView ,並且一旦旋轉設備,顯示的圖像就會失去其中心位置...有人使用了此組件並遇到了相同的情況嗎?
ps:我正在為NIPhotoAlbumScrollView及其NIPagingScrollViewPage使用(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)蒙版
在相應的視圖控制器方法中調用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];
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.