菜鸟教程小白 发表于 2022-12-11 20:20:14

ios - Stripe STPAddCardViewController 导航栏未显示


                                            <p><p>我在我的代码中使用了 strip 。我的 <code>viewController</code> 中有一个 <code>navigationBar</code>。 </p>

<p>这是我的 <code>viewController</code> 的图像:</p>

<p> <a href="/image/Hfcwz.png" rel="noreferrer noopener nofollow"><img src="/image/Hfcwz.png" alt="enter image description here"/></a> </p>

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

<pre><code>let addCardViewController = STPAddCardViewController()

addCardViewController.delegate = self

navigationController?.pushViewController(addCardViewController, animated: true)
</code></pre>

<p>这是生成的图像:</p>

<p> <a href="/image/LRLwB.png" rel="noreferrer noopener nofollow"><img src="/image/LRLwB.png" alt="enter image description here"/></a> </p>

<p>出了什么问题?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您是否可能在代码中的其他地方做某种(或类似)会导致隐藏导航栏的事情?</p>

<p><code>self.navigationController?.navigationBar.isHidden = true</code></p>

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

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

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

<p> <a href="https://gist.github.com/spastorelli-stripe/9ec230dad7a7da5a6f85147deb6a4b3b" rel="noreferrer noopener nofollow">https://gist.github.com/spastorelli-stripe/9ec230dad7a7da5a6f85147deb6a4b3b</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Stripe STPAddCardViewController 导航栏未显示,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/51184028/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/51184028/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Stripe STPAddCardViewController 导航栏未显示