【发布时间】:2016-02-26 12:46:56
【问题描述】:
我有一个标签栏控制器和它的 3 个子节点,我还有另一个视图,我创建了一个从子节点到视图控制器的自定义转场,以及从视图控制器到子节点的自定义展开转场。问题是在展开时,标签栏是隐藏的,它会在展开完成时显示。
这是一个 GIF 示例:
这是我的自定义转场展开代码:
import UIKit
class AddMeCustomSegueUnwind: UIStoryboardSegue {
override func perform() {
// Assign the source and destination views to local variables.
let secondVCView = self.sourceViewController.view as UIView!
let firstVCView = self.destinationViewController.view as UIView!
let screenHeight = UIScreen.mainScreen().bounds.size.height
let window = UIApplication.sharedApplication().keyWindow
//window?.insertSubview(firstVCView, aboveSubview: secondVCView)
//window?.insertSubview(firstVCView, belowSubview: secondVCView)
window?.insertSubview(firstVCView, atIndex: 0)
// Animate the transition.
UIView.animateWithDuration(0.4, animations: { () -> Void in
secondVCView.frame = CGRectOffset(secondVCView.frame, 0.0, -screenHeight + 64)
}) { (Finished) -> Void in
self.sourceViewController.dismissViewControllerAnimated(false, completion: nil)
}
}
}
【问题讨论】:
-
试试这个回复,希望对您有所帮助:stackoverflow.com/questions/20058701/… 另外,这可能会有所帮助stackoverflow.com/questions/15689261/…
标签: ios swift uitabbarcontroller segue unwind-segue