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

  • Home
  • SEARCH
  • 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 8660083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:10:05+00:00 2026-06-12T16:10:05+00:00

I have customized the UIBarButtonItem like this: UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom]; loginBtn.frame =

  • 0

I have customized the UIBarButtonItem like this:

UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
loginBtn.frame = CGRectMake(0, 0, 46.0, 34.0);
[loginBtn setImage:[UIImage imageNamed:@"loginBtn.png"] forState:UIControlStateNormal];
[loginBtn addTarget:self action:@selector(loginPressed:) forControlEvents:UIControlEventTouchUpInside];
[loginBtn setTitle:@"Login" forState:UIControlStateNormal];

UIBarButtonItem *finishedButton = [[UIBarButtonItem alloc] initWithCustomView:loginBtn];

[finishedButton setStyle:UIBarButtonItemStylePlain];
self.navigationItem.rightBarButtonItem = finishedButton;

But now i can not see the title with “Login”, it’s blank on the button, it seems that the “setTitle:” did not work.
Could anybody tell me why? Thx!

  • 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-12T16:10:06+00:00Added an answer on June 12, 2026 at 4:10 pm

    setTitle: did work, you just haven’t read the documentation carefully enough. Use setBackgroundImage: instead of setImage: as the latter overrides setTitle:, but the former doesn’t (and that’s what you want). So instead of

    [loginBtn setImage:[UIImage imageNamed:@"loginBtn.png"] forState:UIControlStateNormal];
    

    write

    [loginBtn setBackgroundImage:[UIImage imageNamed:@"loginBtn.png"] forState:UIControlStateNormal];
                ^
                +- background!
    

    and you should be fine to go.

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

Sidebar

Related Questions

I have customized the TabBar appearance such UIImage *tabBackground = [[UIImage imageNamed:@tab-bar-bg.png] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0,
I have customized UIButton with the following properties: 84x44 frame 84x44 background image 32*32
I have found and customized this JQuery script, which displays different content when different
I have customized UITableViewCell (Static Content Loaded from nib). This cell contains one UILable
I have customized the button in this way: <Button BorderBrush=Transparent Name=DialButton Click=DialButton_Click > <StackPanel
I have customized the camera with custom buttons(UIButton) by overlay view. My iPhone application
I came across this application, that appeared to have customized the UI Picker. I
I have customized a canvas to support the zooming. I am doing this by
I have a jquery datepicker setup. I have customized this so that inside the
I have customized the UIAlertView class. It's working perfectly. I don't want the bounce

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.