修改返回按钮文字

- (void)CreateBarBtton
{
    //创建一个左边按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(clickLeftButton)];
    //    leftButton.
    [leftButton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:  [UIFont fontWithName:@"" size:17.0], NSFontAttributeName,                                        [UIColor whiteColor], NSForegroundColorAttributeName,                                        nil]                              forState:UIControlStateNormal];
    
    self.navigationItem.leftBarButtonItem = leftButton;
    
    //
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"确认" style:UIBarButtonItemStylePlain target:self action:@selector(clickRightButton)];
    
    [rightButton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"" size:17.0], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
    
    self.navigationItem.rightBarButtonItem = rightButton;

    注意/* 3.改变导航栏返回按钮颜色*/ 返回按钮的颜色是tintcolor
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

}

你可能感兴趣的:(修改返回按钮文字)