Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现了很多在 uiNavigationBar 中制作自定义背景的解决方案,但它们都是应用程序范围内的,如何在每个视图中做同样的事情(每个视图都有不同的背景?
这很难完全正确地完成,但是您可以简单地创建一个具有可配置背景图像的子类作为第一步。然后在您从/到其他视图导航时切换背景图像。
您还必须在更改背景时设置栏的 tintColor,以便栏按钮正确着色。