【问题标题】:Add a line below the navigationBar title在导航栏标题下方添加一行
【发布时间】:2011-02-04 06:02:31
【问题描述】:

如何在如下所示的导航栏标题下方添加第二行(较小的字体)?我想在星期天以下显示它

alt text http://img.skitch.com/20100404-8kaabe5f6b5bdf66wt9kfymepw.jpg

【问题讨论】:

    标签: iphone cocoa-touch uitableview uinavigationcontroller


    【解决方案1】:

    [UINavigationItem prompt] 是你要找的。​​p>

    您可以像这样在UIViewControllerinitWithNibName:bundle:(或init,如果您不使用XIB)中设置它:

    [[self navigationItem] setPrompt:@"The best day of the week"];
    

    【讨论】:

    • 谢谢亚当,但这显示在我的标题顶部,而不是它的下方。你知道我怎么把它放在下面吗?
    • 您可以创建一个内部有两个 UILabel 的视图,然后将 [UINavigationItem titleView] 设置为该视图。您必须使一个标签看起来像默认标题,而另一个具有较小字体以模仿标签外观。
    猜你喜欢
    • 2017-02-21
    • 1970-01-01
    • 1970-01-01
    • 2015-07-09
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 1970-01-01
    • 2015-02-19
    相关资源
    最近更新 更多