菜鸟教程小白 发表于 2022-12-12 10:21:34

ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor


                                            <p><p>我有一个'<em>Back</em>' <code>UIBarButtonItem</code>,正如你在第四个 ViewController 中看到的那样</p>

<p> <a href="https://imgur.com/RdoJWFF" rel="noreferrer noopener nofollow"><img src="https://i.imgur.com/RdoJWFF.png" title="Hosted by imgur.com"/></a> </p>

<p><em>Back</em> 按钮连接到 IBAction:</p>

<pre><code>- (IBAction)backClicked:(UIBarButtonItem *)sender
{
    ;
}
</code></pre>

<p>但是当我从第四个 ViewController 调用 <code>popViewControllerAnimated:</code> 以返回到第三个 ViewController 时,它会更改 Tab Bar Tab 的 <code>UINavigationBar</code> tintColor 的原始颜色。 <strong>AppDelegate</strong> 将 UITabBarController 的原始导航栏 tintColor 设置为绿色,然后弹出将其更改为深灰色(第四个 VC 导航栏的颜色)</p>

<p>如何在调用 <code>popViewControllerAnimated:</code> 时不丢失导航栏 tintcolor??请帮忙,这几天我一直在努力解决这个问题。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>检查您没有在前一个 View 的 viewWillAppear 中设置它。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/24128873/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/24128873/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor