gpt4 book ai didi

ios - 翻页时隐藏导航栏

转载 作者:行者123 更新时间:2023-11-30 13:20:06 25 4
gpt4 key购买 nike

我在导航 Controller 中使用 UIPageViewController。仅当用户触摸 View 时才会出现导航栏。现在我想在用户滑动并更改页面时隐藏导航栏。我怎么做?我尝试了下面的代码,但它似乎不起作用。

let currentViewController = self.pageViewController!.viewControllers![0]
let viewControllers = [currentViewController]
self.pageViewController!.setViewControllers(
viewControllers,
direction: .Forward,
animated: true, completion: {
done in self.navigationController?.setNavigationBarHidden(true, animated: false)
})

最佳答案

尝试将其放入用户滑动时到达的页面的 viewWillAppear 方法中

self.navigationController?.setNavigationBarHidden(true, animated: true)

关于ios - 翻页时隐藏导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37852850/

25 4 0