将 UINavigationItem 颜色更改为黑色
我正在查看 Apple 提供的名为 LocateMe 的示例。我的应用程序基于类似的 UI 流程。在该示例中,屏幕的顶部栏是黑色的。查看代码和 xib 文件,我无法弄清楚他们是如何获得顶部的黑条的。当我像他们一样设置我的项目时,我得到蓝色条。请帮忙。
I am looking at example provided by Apple called LocateMe. I am basing my application on similar UI flow. In that example the top bar of the screen is black. Looking in the code and xib file I am not able to figure out how did they get that black bar on the top. When I set up my project exactly like them, I get blue bar. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该特定项目通过在其
Info.plist
中将UIStatusBarStyle
设置为UIStatusBarStyleOpaqueBlack
来实现此目的(这就是您找不到它的原因)。您也可以通过以下方式在代码中实现此目的:编辑:我重新阅读了您的问题,目前尚不清楚您是在询问导航控制器栏还是状态栏(这是屏幕最顶部的栏) 。以上是状态栏。通过转到 GetLocationSetupView.xib 并选择导航栏并选择“黑色不透明”样式,将导航控制器栏设置为黑色。
That particular project did it by setting
UIStatusBarStyle
toUIStatusBarStyleOpaqueBlack
in theirInfo.plist
(which is why you couldn't find it). You can also achieve this in code this way:EDIT: I re-read your question, and it's not clear whether you're asking about the navigation controller bar or the status bar (which is the bar at the very top of the screen). The above is for the status bar. The Navigation Controller bar was set to black by going to the GetLocationSetupView.xib and selecting the Navigation Bar and selecting the "Black Opaque" style.