修改返回按钮文字

- (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];

}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容