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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:46:04+00:00 2026-05-26T20:46:04+00:00

I have a UIToolbar. If I create a UIBarButton like this, it works: UIBarButtonItem

  • 0

I have a UIToolbar.

If I create a UIBarButton like this, it works:

UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithImage:iOB style:UIBarButtonItemStylePlain target:self action:@selector(myStuff)];
[button setTitle:@"Hi"];

If I create the UIBarButton like this, cause I want it to be colored:

UIImageView *vUP = [[UIImageView alloc] initWithImage:iUP];
UIBarButtonItem *UPButton = [[UIBarButtonItem alloc] initWithCustomView:vUP];
[UPButton setAction:@selector(anotherStuff)];
[UPButton setTitle:@"Hi";
[UPButton setTarget:self];
[vUP release];

The button shows, WITHOUT title and will doesn’t respond to any touch…

am I missing something?

  • 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-26T20:46:05+00:00Added an answer on May 26, 2026 at 8:46 pm
    UIImage* image3 = [UIImage imageNamed:@"plain_btn-75-30.png"];
    CGRect frameimg = CGRectMake(0, 0, image3.size.width, image3.size.height);
    
    UIButton *someButton = [[UIButton alloc] initWithFrame:frameimg];   
        [someButton setBackgroundImage:image3 forState:UIControlStateNormal];
        [someButton addTarget:self action:@selector(backButtonPress:)forControlEvents:UIControlEventTouchUpInside];
        [someButton setShowsTouchWhenHighlighted:YES];
        [someButton setTitle:@"Back" forState:UIControlStateNormal];
        someButton.titleLabel.font = [UIFont fontWithName:@"Helvetica" size:13];
    
        [someButton setTitleColor:[UIColor blackColor]  forState:UIControlStateNormal];
    
         UPButton =[[UIBarButtonItem alloc] initWithCustomView:someButton];
    

    If you want image and title both then image must be set as a background image with title.

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

Sidebar

Related Questions

so I have a UIToolbar with a label(actually a UIBarButtonItem) on it like so:
I'm writing a Navigation-Based iPhone app, and I'd like to have a UIToolBar docked
I have a UISegmentedControl on a black UIToolbar. I have set the style to
I have an UITableViewController which I would like to add UIToolbar to with one
I have a UIToolbar that needs three buttons in a radio style, meaning that
I'd love to create a back left-arrow-bezel button in a UIToolbar . As far
I have a UITableViewController. I'd like to display a UIToolbar at the bottom but
I have a UIToolbar with a UIBarButtonItem that I created in Interface Builder. The
I have view that has a webview and a UIToolbar. I want to create
I have added a blue UIBarButtonItem to a UIToolbar in my app and changed

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.