码迷,mamicode.com
首页 > 其他好文 > 详细

修改NavigationBarItem的字体大小和颜色的使用方法

时间:2016-07-08 15:00:24      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:

 

//创建一个左边按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:@"<" style:UIBarButtonItemStylePlain target:self action:@selector(clickLeftButton)];
    //    leftButton.
    
    [leftButton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                        [UIFont fontWithName:@"Helvetica-Bold" size:17.0], NSFontAttributeName,
                                        [UIColor greenColor], NSForegroundColorAttributeName,
                                        nil]
                              forState:UIControlStateNormal];
    //创建一个右边按钮
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"登陆" style:UIBarButtonItemStyleDone target:self action:@selector(clickRightButton)];
    [rightButton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                         [UIFont fontWithName:@"Helvetica-Bold" size:17.0], NSFontAttributeName,
                                         [UIColor greenColor], NSForegroundColorAttributeName,
                                         nil]
                               forState:UIControlStateNormal];

 

修改NavigationBarItem的字体大小和颜色的使用方法

标签:

原文地址:http://www.cnblogs.com/jukaiit/p/5653104.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!