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

navigationItem标题以及左右button的创建...

时间:2014-09-10 02:57:50      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:button   左右   


创建TableView的navigationItem的Text  左右Button

- (void)customizeNavigationBarContent
{
    //titleView
    UILabel *labelTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
    labelTitle.text = @"添加联系人";
    labelTitle.textColor = [UIColor whiteColor];
    labelTitle.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = labelTitle;
    RELEASE_SAFE(labelTitle);
    //leftBar
    UIBarButtonItem *barLeft = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"clsose"] style:(UIBarButtonItemStylePlain) target:self action:@selector(handleBack:)];
    self.navigationItem.leftBarButtonItem = barLeft;
    RELEASE_SAFE(barLeft);
    //rightBar
    UIBarButtonItem *barRight = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"doneR"] style:(UIBarButtonItemStylePlain) target:self action:@selector(handleSave:)];
    self.navigationItem.rightBarButtonItem = barRight;
    RELEASE_SAFE(barRight);
}

navigationItem标题以及左右button的创建...

标签:button   左右   

原文地址:http://9178487.blog.51cto.com/9168487/1550162

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