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 7879153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:50:19+00:00 2026-06-03T03:50:19+00:00

My iPhone app has a tab bar controller and on each tab (4 tabs)

  • 0

My iPhone app has a tab bar controller and on each tab (4 tabs) there is a UINavigationController that I want to be a different color and change the font on the title, so I made my own custom navigation controller to use everywhere so those changes are only in 1 place. The tint is easy and works fine, but when I try to set the font using setTitleTextAttributes, it changes the font but on some views the title shows up being cut off at the end (ie. “My titl…”). If I change views and then come back to the view with the cut off title, the title does show up properly though.

Currently my viewDidLoad in my custom UINavigationController has:

UIFont *font = [UIFont fontWithName:@"GillSans-Bold" size:22];
NSDictionary *attr = [[NSDictionary alloc] initWithObjectsAndKeys:font, UITextAttributeFont, nil];
[self.navigationBar setTitleTextAttributes:attr];

My thought was that it’s changing the font of the titleView but it’s not being resized in accordance to the new size (since it’s a bigger font). Another issue is when the phone is turned to landscape, any letters that hang low (g, p, y) have the bottoms cut off. Is there a way to resize the label or allow for minimumFontSize to be set so the text simply shrinks when it’s too big?

  • 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-03T03:50:20+00:00Added an answer on June 3, 2026 at 3:50 am

    This worked for me

    - (void)viewWillAppear:(BOOL)animated {
        [super viewWillAppear:animated];
        [self setTitle:self.station.title];
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 400, 44)];
        label.backgroundColor = [UIColor clearColor];
        [label setFont:[UIFont fontWithName:@"GillSans-Bold" size:24.0]];
        label.textAlignment = UITextAlignmentCenter;
        label.textColor = [UIColor whiteColor];
        label.adjustsFontSizeToFitWidth = YES;
        label.text = self.title;    
        self.navigationItem.titleView = label;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My iPhone app is a Tab Bar Application, which has 5 tabs. In each
I have an iPhone app that has four tabs. On Tab 1 there is
I've created a small iphone app that contains a tab bar controller that has
My iPhone app has a tab bar controller, and one of the tabs is
I am working on iphone app that has tab bar at the bottom of
My iPhone app has a tab bar controller at the bottom of the view
One of the tab bar controller tabs in my iPhone app changes what it
I've an Tab-bar based iPhone app. the app consiste of 2 tabs. Each tab
I am working on an iPhone app that has a tab bar. I made
I am creating an iphone app with 5 tabs, each tab has a root

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.