效果图:
代码示例:
//在viewDidLoad中:
NSString * childNumber = [NSString stringWithFormat:@"%@", responseObject[@"rtn"][@"body"][@"serviceCount"]];
NSString * item = [NSString stringWithFormat:@"目前正在管理服务%@名儿童", childNumber];
NSMutableAttributedString * attString = [[NSMutableAttributedString alloc] initWithString:item];
[attString addAttributes:@{NSForegroundColorAttributeName:kColorYellow} range:[item rangeOfString:childNumber]];
itemLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 200, 20)];
itemLabel.textColor = [UIColor whiteColor];
itemLabel.attributedText = attString;
self.navigationItem.titleView = itemLabel;
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。