ios title 加粗oc代码
时间: 2023-03-30 19:02:22 浏览: 192
可以使用NSAttributedString来设置title的样式,具体代码如下:
```
NSMutableAttributedString *attributedTitle = [[NSMutableAttributedString alloc] initWithString:@"Title"];
[attributedTitle addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17.] range:NSMakeRange(, attributedTitle.length)];
self.navigationItem.titleView = [[UILabel alloc] init];
[(UILabel *)self.navigationItem.titleView setAttributedText:attributedTitle];
[(UILabel *)self.navigationItem.titleView sizeToFit];
```
阅读全文