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

标题: ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:21
标题: ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor

我有一个'Back' UIBarButtonItem,正如你在第四个 ViewController 中看到的那样

Back 按钮连接到 IBAction:

- (IBAction)backClickedUIBarButtonItem *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

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

如何在调用 popViewControllerAnimated: 时不丢失导航栏 tintcolor??请帮忙,这几天我一直在努力解决这个问题。



Best Answer-推荐答案


检查您没有在前一个 View 的 viewWillAppear 中设置它。

关于ios - popViewControllerAnimated 改变 UINavigationBar 的 UIColor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24128873/






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