NIPhotoAlbumScrollView: невозможно настроить изображение после поворота устройства
Я использую NIPhotoAlbumScrollView из каркаса Nimbus, и когда я поворачиваю устройство, отображаемое изображение теряет центральное положение... Кто-то использовал этот компонент и сталкивался с моей такой же ситуацией?
PS: я использую маску (UIViewAutoresizingF FlexibleWidth | UIViewAutoresizingF FlexibleHeight) для NIPhotoAlbumScrollView и его NIPagingScrollViewPage
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