首页 > 代码库 > 定制navigationBar

定制navigationBar

- (void)configureNavigationBar
{
    //设置navigationBar的颜色
    UILabel * titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 40)];
    titleLabel.textColor = [UIColor whiteColor];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text =@"通讯录";
    self.navigationItem.titleView = titleLabel;
    self.navigationController.navigationBar.barTintColor = [UIColor lightGreenColor];
    
    RELEASE_SAFE(titleLabel);
}

定制navigationBar