iOS开发超神学院

给UIBarButtonItem设置字体大小和颜色

2016-09-09  本文已影响575人  hx永恒之恋
UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc]initWithTitle:@"查看商品" style:(UIBarButtonItemStylePlain) target:self action:@selector(rightBtnAction)];
// 字体颜色
[rightBtn setTintColor:[UIColor redColor]
 ];
// 字体大小
[rightBtn setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont boldSystemFontOfSize:12], NSFontAttributeName,nil] forState:(UIControlStateNormal)];
self.navigationItem.rightBarButtonItem = rightBtn;
上一篇下一篇

猜你喜欢

热点阅读