OGeek|极客世界-中国程序员成长平台

标题: ios - Stripe STPAddCardViewController 导航栏未显示 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:20
标题: ios - Stripe STPAddCardViewController 导航栏未显示

我在我的代码中使用了 strip 。我的 viewController 中有一个 navigationBar

这是我的 viewController 的图像:

enter image description here

但是当我导航到 STPAddCardViewController 时,STPAddCardViewController 的导航栏没有显示。我正在使用此代码:

let addCardViewController = STPAddCardViewController()

addCardViewController.delegate = self

navigationController?.pushViewController(addCardViewController, animated: true) 

这是生成的图像:

enter image description here

出了什么问题?



Best Answer-推荐答案


您是否可能在代码中的其他地方做某种(或类似)会导致隐藏导航栏的事情?

self.navigationController?.navigationBar.isHidden = true

仅凭您发布的片段,我认为很难确切说明为什么会发生这种情况。我们可能需要查看更多 ViewController 的代码

我建议查看您的代码是否没有执行上述操作。

这是一个非常简单的示例 VC,它使用 AddCardViewController 推送到导航 Controller 上,希望可以提供帮助。这应该没有你描述的问题:

https://gist.github.com/spastorelli-stripe/9ec230dad7a7da5a6f85147deb6a4b3b

关于ios - Stripe STPAddCardViewController 导航栏未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51184028/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4