更新时间:2023-12-03 14:11:46
外观代理仅影响新初始化视图的外观。在外观代理上设置颜色不会对已经可见的导航栏产生影响。
The appearance proxy only affects the look of newly initialized views. Setting colors on the appearance proxy will have no effect on navigation bars that are already visible.
您需要手动更新当前视图;例如:
You'll need to manually update your current view; for example:
self.navigationController.navigationBar.barTintColor = [UINavigationBar appearance].barTintColor;