ios - 重置导航栏

标签 ios swift uinavigationcontroller uibutton segue

我已经使用了一个 View Controller ,它嵌入在导航 Controller 中用于标题目的。我想删除按钮,该按钮允许我返回到最后一个 View Controller ,而不必取消嵌入导航 Controller 。我该怎么做?

I want to remove the grade button

最佳答案

您可以通过访问 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/

相关文章:

ios swift 方形照片取景器

iPhone 5 隐藏在 View 中的栏的布局

ios - UIImagePickerController swift 的问题

iphone - 触摸时隐藏导航栏和工具栏

objective-c - UINavigationController - 推送时保持导航栏相同

objective-c - 将字符串解析为不同类型的数字字符串

ios - 如何检测 AVplayer 并从 WKWebView 获取当前视频的 url?

ios - 动态约束更新

iphone - iOS UInavigation bar to uitableviewcontroller not as rootviewcontroller in appdelegate

ios - 在 iOS 13 全屏中呈现模态