【发布时间】:2015-11-17 05:01:22
【问题描述】:
我有一个 UITableViewController,在我的 UITableViewCell 内,当用户点击它时,我有一个 imageView,我使用我自己的自定义 UIViewControllerContextTransitioning 模态地呈现它以对其进行缩放效果,它就像一个魅力,问题是当动画完成,我调用了
[transitionContext completeTransition:YES];
现在位于 Modal UIViewController 后面的 UITableView 已从视图层次结构中移除,因此我在其后面出现黑屏
[containerView addSubview:toViewController.view];
[UIView animateWithDuration:duration delay:0.0 usingSpringWithDamping:damping initialSpringVelocity:1.0 / damping options:0 animations:^{
// blablabla animation stuff
} completion:^(BOOL finished) {
[transitionContext completeTransition:YES];// this line makes my UITableView removed form the view hierarchy
}];
这是我迄今为止尝试过的:
在完成块中添加 UITableView
[[UIApplication sharedApplication ].keyWindow insertSubview:fromViewController.view belowSubview:containerView];
但这仅适用于 iOS8 ...
任何想法如何解决这个问题?谢谢!!
【问题讨论】:
标签: ios objective-c uitableview cocoa-touch core-animation