Change font of back navigation bar button

前端 未结 7 1120
走了就别回头了
走了就别回头了 2020-12-04 17:38

I want to be able to set the font of my apps navigation bar back button without doing anything too crazy and without losing any other design characteristics of the button (i

相关标签:
7条回答
  • 2020-12-04 18:27

    Use this instead in your AppDelegate or where the NavigationController is initialized, method available in iOS 5 and above

    UIBarButtonItem *backbutton =  [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStyleBordered target:nil action:nil];  
    [backbutton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       [UIColor blackColor],UITextAttributeTextColor,[UIFont fontWithName:TEXTFONT size:16.0f],UITextAttributeFont,
                                                       nil] forState:UIControlStateNormal]; 
    
    0 讨论(0)
提交回复
热议问题