Double title

更新时间:
复制 MD 格式

AUDoubleTitleView is a view control for displaying a two-line title that consists of a main title and a subtitle in a navigation bar.

Preview

API reference

    /**
 A titleView for a navigation bar that contains two lines.
 */
@interface AUDoubleTitleView : UIView

/**
 *  Creates a titleView with a main title and a subtitle.
 *
 *  @param title          The main title.
 *  @param detaileTitle   The subtitle.
 *
 *  @return An initialized APTitleView control.
 */
- (UIView *)initWithTitle:(NSString *)title detailTitle:(NSString *)detaileTitle;

/**
 *  Updates the text of the main title.
 *
 *  @param title          The text of the main title.
 *
 */
- (void)updateTitle:(NSString *)title;

/**
 *  Updates the text of the subtitle.
 *
 *  @param detailTitle          The text of the subtitle.
 *
 */
- (void)updateDetailTitle:(NSString *)detailTitle;


/**
 Updates the font of the main title.

 @param titleFont The font of the main title.
 */
- (void)updateTitleFont:(UIFont *)titleFont;

/**
 *  Updates the font of the subtitle.
 *
 *  @param detailTitleFont      The font of the subtitle.
 *
 */
- (void)updateDetailTitleFont:(UIFont *)detailTitleFont;

@end

Code example

self.navigationItem.titleView = [[AUDoubleTitleView alloc] initWithTitle:@"Main Title" detailTitle:@"Subtitle"];