导航栏按钮主题

  • 导航栏的左上角和右上角都是UIBarButtonItem对象,为了统一样式,也可以设置UIBarButtonItem
UIBarButtonItem *item = [UIBarButtonItem appearence];                    
  • 设置主题的方法

  1.背景

- (void)setBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;

  2.文字

- (void)setTitleTextAttributes:(NSDictionary *)attributes forState:(UIControlState)state;

  3.导航栏返回按钮背景

- (void)setBackButtonBackgroundImage:(UIImage *)backgroundImage forState:(UIControlState)state barMetrics:(UIBarMetrics)barMetrics;
原文地址:https://www.cnblogs.com/cxios/p/4221596.html