简体   繁体   English

iOS中的导航栏按钮可见性问题

[英]Navigation bar button visibility issue in iOS

I am having issue with the navigation bar buttons. 我的导航栏按钮有问题。 It looks good(visible) when present the view controller. 存在视图控制器时,它看起来不错(可见)。 When I present a another view controller on it it disappears the previous view controller bar button item (But they work when taps but not visible). 当我在其上显示另一个视图控制器时,它会消失之前的视图控制器栏按钮项(但是当点击但不可见时它们会起作用)。

I am presenting the new view controller like this 我正在展示这样的新视图控制器

let navVC = UINavigationController(rootViewController: serverPhotosCategoryVC)
            navVC.modalTransitionStyle = presentationStyle
            appDelegateObj.navigationController?.presentViewController(navVC, animated: true, completion: nil)

Please let me know what could be the issue. 请让我知道可能是什么问题。 I have tried many types of codes for that. 我为此尝试了多种类型的代码。 But they can't help it. 但是他们无能为力。

Thanks 谢谢

If you present from viewController, should present from viewController instead of using navigationController 如果您从viewController呈现,则应该从viewController呈现,而不是使用navigationController

let navVC = UINavigationController(rootViewController: serverPhotosCategoryVC)
navVC.modalTransitionStyle = presentationStyle
self.presentViewController(navVC, animated: true, completion: nil)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM