objective-c – 如何在不需要时摆脱UIAppearance?

objective-c – 如何在不需要时摆脱UIAppearance?,第1张

概述在我的AppDelegate中,我使用UIAppearance设置我自己的NavigationBar与此代码: [[UINavigationBar appearance] setTintColor:[UIColor blackColor]];[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"nav5.pn 在我的AppDelegate中,我使用UIAppearance设置我自己的Navigationbar与此代码:
[[UINavigationbar appearance] setTintcolor:[UIcolor blackcolor]];[[UINavigationbar appearance] setBackgroundImage:[UIImage imagenamed:@"nav5.png"] forbarMetrics:UIbarMetricsDefault];

但是我的应用程序的一些看法不需要它.我如何摆脱它,所以我只能在有意见的视图中使用IB?

解决方法 您不需要使用代理.只要得到实际的导航栏,它应该看起来不一样,直接在它上面设置颜色.
[navigationbarInstance setTintcolor:[UIcolor blackcolor]];[navigationbarInstance setBackgroundImage:[UIImage imagenamed:@"nav5.png"] forbarMetrics:UIbarMetricsDefault];

您也可以将这两个值都设置为nil,再次选择标准样式. (由本克莱顿测试).

[navigationbarInstance setTintcolor:nil];[navigationbarInstance setBackgroundImage:nil forbarMetrics:UIbarMetricsDefault];
总结

以上是内存溢出为你收集整理的objective-c – 如何在不需要时摆脱UIAppearance?全部内容,希望文章能够帮你解决objective-c – 如何在不需要时摆脱UIAppearance?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1253966.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存