gpt4 book ai didi

iphone - NIPhotoAlbumScrollView : unable to adjust image after device rotation

转载 作者:行者123 更新时间:2023-11-29 04:48:32 24 4
gpt4 key购买 nike

我正在使用 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com