我已经使用了一个 View Controller ,它嵌入在导航 Controller 中用于标题目的。我想删除按钮,该按钮允许我返回到最后一个 View Controller ,而不必取消嵌入导航 Controller 。我该怎么做?
最佳答案
您可以通过访问 UINavigationController 的 navigationItem 并使用 setHidesBackButton(_:animated:)
方法来完成此操作。
self.navigationController?.navigationItem.setHidesBackButton(true, animated: false)
您可以在此处阅读 Apple 文档中有关该方法的信息:https://developer.apple.com/reference/uikit/uinavigationitem/1624934-sethidesbackbutton
关于ios - 重置导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42891267/