gpt4 book ai didi

ios - 当我从一个 View Controller 展开到另一个作为选项卡栏 Controller 子级的 View Controller 时,如何显示选项卡栏 Controller ?

转载 作者:搜寻专家 更新时间:2023-11-01 07:29:01 26 4
gpt4 key购买 nike

我有一个标签栏 Controller 和它的 3 个 child ,我还有另一个 View ,我制作了一个从 child 到 View Controller 的自定义转场,还有一个从 View Controller 到 child 的自定义展开转场。问题是,在展开时,标签栏是隐藏的,它会在展开完成时显示。

这是一个 GIF 示例:

enter image description here

这是我的自定义 segue unwind 代码:

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)
}
}
}

最佳答案

为了像我说的那样使展开工作,需要从选项卡栏 Controller 完成展开转场,所以我创建了一个 UITabBarController 并向其中添加了相同的展开。

关于ios - 当我从一个 View Controller 展开到另一个作为选项卡栏 Controller 子级的 View Controller 时,如何显示选项卡栏 Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33887531/

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