Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:01:56+00:00 2026-06-05T02:01:56+00:00

I am customizing the back button in the navigation bar using appearance proxy, also

  • 0

I am customizing the back button in the navigation bar using appearance proxy, also setting image and text attributes. Everything works fine but the text in back button is not center aligned.

Here is my code.

UIBarButtonItem *backButton = [[[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStyleBordered target:nil action:nil] autorelease];
 UIImage *buttonBack32 = [[UIImage imageNamed:@"NavigationBackButton"] 
                         resizableImageWithCapInsets:UIEdgeInsetsMake(0, 10, 0, 5)];

[[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBack32 forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
 [[UIBarButtonItem appearance] setTitleTextAttributes:
 [NSDictionary dictionaryWithObjectsAndKeys:
        [UIColor whiteColor], 
        UITextAttributeTextColor, 
        [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8], 
        UITextAttributeTextShadowColor, 
        [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], 
        UITextAttributeTextShadowOffset,
  [UIFont fontWithName:@"xxx" size:16.0], 
  UITextAttributeFont,
  nil] 
                                            forState:UIControlStateNormal]; 
self.navigationItem.backBarButtonItem = backButton;

If I set the font size “0.0” then text becomes too small in size and still not centered aligned.

Thanks in advance for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:01:58+00:00Added an answer on June 5, 2026 at 2:01 am

    You can use the setTitlePositionAdjustment:forBarMetrics: method to set the title offset as required. For example:

    [[UIBarButtonItem appearance] setTitlePositionAdjustment:UIOffsetMake(0.0f, 5.0f) forBarMetrics:UIBarMetricsDefault];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck at customizing the navigation bar of my app. I added the navigation
I'm having issues customizing a radio button for a specific form using hook_theme. Below
Customizing TabItem I have a TabControl bound to my ViewModel i also want to
I am customizing a Process Template for TFS2008. I am using the MSF for
I ran into the following problem: I'm customizing the whole appearance of my app.
I have problem with customizing each page using pagecontrol and UIScrollView. I'm customizing Page
I am customizing an SSRS report, using an existing DataSource and DataSet. I can't
I am customizing an ExapndableListView,, I am trying to add a Button to the
Has anybody succeeded in customizing the Places Bar for VS 2008? My customizations from
I'm customizing the default workflow of build process template using TFS 2010 Team Build.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.