工具栏下方的 UIImageView CurlUp 过渡
我目前正在致力于在 iPad 应用程序中实现幻灯片控件。
我想管理图像之间不同类型的过渡,特别是 UIViewAnimationOptionTransitionCurlUp。
我的 ViewController 的 xib 由两个叠加的 UIImageView 组成,两个 UIImageView 上有一个 UIToolbar ,以便为用户提供播放/暂停控制。
它是这样的:
我今天面临这样的问题:当我的两个 UIImageViews 之间发生 CurlUp 转换时,我也看到 UIToolbar (通常位于其他两个视图之上)动画:
这是我的转换代码的样子:
if ([slideshow.images count] <= 1)
{
return;
}
currentImageIndex = ((currentImageIndex + 1) >= [slideshow.images count]) ? 0 : currentImageIndex + 1;
//imageStackView contains the two UIImageViews bound as IBOutlets from my xib
UIImageView *loadingImageView = [imageViewStack objectAtIndex:1];
loadingImageView.image = [slideshow.images objectAtIndex:currentImageIndex];
UIImageView *currentImageView = [imageViewStack objectAtIndex:0];
[UIView transitionFromView:currentImageView
toView:loadingImageView
duration:slideshow.duration
options:UIViewAnimationOptionTransitionCurlUp
completion:^(BOOL finished) {
UIImageView *swap = [imageViewStack objectAtIndex:0];
[self.view bringSubviewToFront:toolbar];
[imageViewStack removeObjectAtIndex:0];
[imageViewStack addObject:swap];
[self scheduleNextAnimation];
}];
如果您对此有任何想法,请告诉我!
提前致谢 !
I am currently working on the implementation of a slideshow control in an iPad application.
I would like to manage different kinds of transitions between the images, particularly the UIViewAnimationOptionTransitionCurlUp.
My ViewController's xib is composed of two superposed UIImageViews, with a UIToolbar over the two UIImageViews in order to give the user a play/pause control.
Here is how it looks like :
I today face the problem that when the CurlUp transition occurs between my two UIImageViews, I see the UIToolbar (which is normally over the two other views) animate as well :
Here is how my transition code looks like :
if ([slideshow.images count] <= 1)
{
return;
}
currentImageIndex = ((currentImageIndex + 1) >= [slideshow.images count]) ? 0 : currentImageIndex + 1;
//imageStackView contains the two UIImageViews bound as IBOutlets from my xib
UIImageView *loadingImageView = [imageViewStack objectAtIndex:1];
loadingImageView.image = [slideshow.images objectAtIndex:currentImageIndex];
UIImageView *currentImageView = [imageViewStack objectAtIndex:0];
[UIView transitionFromView:currentImageView
toView:loadingImageView
duration:slideshow.duration
options:UIViewAnimationOptionTransitionCurlUp
completion:^(BOOL finished) {
UIImageView *swap = [imageViewStack objectAtIndex:0];
[self.view bringSubviewToFront:toolbar];
[imageViewStack removeObjectAtIndex:0];
[imageViewStack addObject:swap];
[self scheduleNextAnimation];
}];
Please let me know if you have any idea about this !
Thanks in advance !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过将笔尖中的两个 UIImageView 附加到父 UIView 中解决了这个问题。
结果,我有一个视图层次结构如下:
I solved this problem by appending the two UIImageViews in my nib in a parent UIView.
As a result, I have a view hierarchy as following :