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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:51:03+00:00 2026-05-28T05:51:03+00:00

I created UINavigationController application. I added UILabel to UINavigationBar, but there is a problem.

  • 0

I created UINavigationController application. I added UILabel to UINavigationBar, but there is a problem. My label is not moving when UINavigationBar is moving to left or to right. How do I solve the problem?

UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(70, 0, 200, 44)] autorelease];
label.text = @"There are too car on the ...";
label.backgroundColor = [UIColor clearColor];
[self.navigationController.navigationBar addSubview:label]; 
  • 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-05-28T05:51:04+00:00Added an answer on May 28, 2026 at 5:51 am

    The problem here is that you set the label directly on the UINavigationBar. If you don’t need a customized label and the default behavior is enough for you, you should set the UIViewController title property instead. However, if you need a customized label, you should set your UIViewController’s navigationItem titleView property. Check out the example below. I assume self is an active view controller:

    // for a simple title, just set the view controllers title property
    [self setTitle:@"There are too car on the ...";
    
    // for a custom label, you need to set navigationItem.title property
    UILabel *label = [[[UILabel alloc] init] autorelease];
    label.text = @"There are too car on the ...";
    label.textColor = [UIColor yellowColor];
    label.backgroundColor = [UIColor redColor];
    [self.navigationItem setTitleView:label];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application, I have a UINavigationController with a UINavigationBar that I created programmatically.
I've created an ARC Application that run's perfect. It's got a UINavigationController that I
I have created a window-based application and my problem is I am unable to
I have an application that isn't nav based. So there is no UINavigationController in
I've created a very simple app with a UINavigationController as the root controller but
i created an iPad application, in which navigation is not working, for example on
I created a simple .NET windows application in Visual Studio 2005 and on just
I created a Rails application normally. Then created the scaffold for an event class.
I have created tab bar programmatically in the view controller. In my application, Initially
I want to ask a question about the UINavigationController on iPhone application. I create

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.