我正在使用滑动手势代码来翻转图像,它调用此代码:
- (void)rightSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer {
for (UIImageView *imageView in imageArray)
{
if (([imageView isKindOfClass:[UIImageView class]] && imageView.tag == ((UISwipeGestureRecognizer *)gestureRecognizer).view.tag))
{
[UIView transitionWithView:imageView duration:0.5
options:UIViewAnimationOptionTransitionFlipFromRight animations:^{
//imageView.image = secondImage;
} completion:^(BOOL f){
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"PhotoViewControllerStoryboard" bundle:nil];
UIViewController *vc = [sb instantiateInitialViewController];
vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:vc animated:YES completion:NULL];
vc.view.frame = CGRectMake(343, 163, 316, 546.5);
}
];
}
}
}
翻转可以正常工作,但是当动画结束时,视图控制器会在黑色背景中加载。UIImage
如果它是图像的背面,我希望它以类似的方式加载。我怎样才能做到这一点??
编辑: