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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:48:58+00:00 2026-06-01T23:48:58+00:00

I have set UINavigationBar titleView as given below: UIView *labelView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 255,

  • 0

I have set UINavigationBar titleView as given below:

UIView *labelView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 255, 40)];
       UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 40)];
       [label setTextColor:[UIColor whiteColor]];
        label.lineBreakMode=UILineBreakModeWordWrap;
        label.numberOfLines=0;
        label.shadowColor = [UIColor colorWithRed:0.0f/255.0f green:0.0f/255.0f blue:0.0f/255.0f alpha:0.25f];
        label.shadowOffset = CGSizeMake(0.0f, -1.0f);
        label.textAlignment = UITextAlignmentCenter;
        label.adjustsFontSizeToFitWidth=YES;


      [label setBackgroundColor:[UIColor clearColor]];

      switch (genreId) {
       case 1:
        label.text=@"Music";
        self.navigationItem.titleView =label;
        break;
       case 3:
        label.text=@"Family";
        break;
       case 6:
        label.text=@"Literature";
        break;
       case 7:
        label.text=@"Theatre";
        break;
       default:
        label.frame=CGRectMake(0, 0, 255, 40);
        label.text=ArtistName;
        break;
      }


      [label setFont:[UIFont boldSystemFontOfSize:20.0]];
      [labelView  addSubview:label];
      [self.navigationItem setTitleView:labelView];

      [label release];

Now I want to update the height of UINavigationBar because word wrap in title view will not display until we increase the height of the UINavigationBar.How can I do that?

  • 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-01T23:49:00+00:00Added an answer on June 1, 2026 at 11:49 pm

    use this code…..and chill……

    NSString *summary;
    summary = @" your title";
    
     // define font size what ever you want....
    CGSize s = [summary sizeWithFont:[UIFont systemFontOfSize:30] 
                   constrainedToSize:CGSizeMake(self.view.bounds.size.width - 40, MAXFLOAT)     // - 40 For cell padding
                       lineBreakMode:UILineBreakModeWordWrap];
    
    
    
    CGRect frame = CGRectMake(0.0f, 0.0f, 320.0f, s.height);
    [self.navigationController.navigationBar setFrame:frame];
    

    Hope, it will help you…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm customizing UINavigationBar and have to set a custom background image to the navigation
I have set a custom tint color for a UINavigationBar (within a UINavigationController )
I have set the below parameters in sqlplus to display my view out put
I have a UInavigationBar that is set to hidden in the view did load.
I have a UINavigationBar and have the leftBarButtonItem and rightBarButtonItem set. The leftbar is
I have this code that changes the back button of my UINavigationBar // Set
I have set up multiple targets in a single xml file. I expect all
I have set up 2 servers which are linked. From my LOCAL SERVER, I
I have :set hlsearch as default value. When I search for something, search terms
We have set up a SharePoint meeting workspace (using WSS 3.0) for our weekly

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.