gpt4 book ai didi

swift - 快速重置 hidesBarsOnSwipe

转载 作者:行者123 更新时间:2023-11-28 10:23:56 25 4
gpt4 key购买 nike

我必须在哪里以及如何重置 hidesBarsOnSwipe?我在我推送的 View Controller 中设置了该选项,并希望为执行推送的 View Controller 重置它。到目前为止,我尝试的是在推送 ViewController 的 viewDidDisappearviewDidLoad 中将 hidesBarsOnSwipe 设置为 false

导航栏仍在消失。

override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if (!visiblePOIs.isEmpty) {
let beaconInfo = visiblePOIs[indexPath.item]
var controller = storyboard!.instantiateViewControllerWithIdentifier("DetailController")! as! DetailController
controller.setup(beaconInfo)
self.parentViewController!.navigationController?.pushViewController(controller, animated: true)
}
}

细节 Controller

override func viewDidLoad() {
super.viewDidLoad()
webView.delegate = self
navigationController?.hidesBarsOnSwipe = true
self.automaticallyAdjustsScrollViewInsets = false
}

最佳答案

下一个viewcontroller写入viewDidload

First Vc

override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.hidesBarsOnSwipe = true
}

Second VC
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.hidesBarsOnSwipe = false
self.navigationController?.setNavigationBarHidden(false, animated: true)
}

我希望它的作品

关于swift - 快速重置 hidesBarsOnSwipe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30325292/

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