自定义导航栏样式 - iOS [英] Custom nav bar styling - iOS
问题描述
可能重复:
。
导航栏完全自定义样式是非常困难的。
我知道的最好的写法是Sebastian Celis的这个:
http://sebastiancelis.com/2009/12/21/adding-background-image-uinavigationbar/
这不会覆盖drawRect,并且包括一个很好的解释为什么这是一件好事。
另外请注意,你不必按照他的教程。您可以在这里下载完整的代码:
https://github.com/scelis/ExampleNavBarBackgroundPossible Duplicate:
How to add background image on iphone Navigation bar?iOS - How did the NY Times do this custom top navigation bar styling?
And for that matter, the bottom one?
Thanks...
解决方案EDIT: This is outdated; for iOS5 there's a much better answer below, by @Jenox.
Completely custom styling for Navigation Bars is surprisingly difficult. The best writeup I know of is this one by Sebastian Celis: http://sebastiancelis.com/2009/12/21/adding-background-image-uinavigationbar/
This doesn't override drawRect, and includes a good explanation why that's a good thing. Also note you don't have to follow his tutorial. You can download the complete code here: https://github.com/scelis/ExampleNavBarBackground
这篇关于自定义导航栏样式 - iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!