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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:49:24+00:00 2026-06-12T00:49:24+00:00

I have a UIToolbar containing 2 UIBArButton items. The toolbar is inside a UITableViewCell,

  • 0

I have a UIToolbar containing 2 UIBArButton items. The toolbar is inside a UITableViewCell, and it fades in when the user selects a cell. The problem is that when the cell get’s highlighted, it calls highlight on the barButtonItems as well, and they stay highlighted until the user manually tap the button once, and then it goes back to standard highlighting.

Is there a way to unhighlight the UIBarButtonItems manually?

I tried the overriding the cell’s setSelected: and setHighlighted methods, and have tried calling both setSelected: and setHighlighted on the subviews as well, as shown below, and it doesn’t seem to work. highlighted is called on 1 UIToolbarBackground and 2 UIToolbarTextButtons. Any ideas?

@implementation CustomCell

// I also tried doing this in setHighlighted: & setHighlighted:animated
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
   [super setSelected:selected animated:animated];

   for (UIView *view in self.toolbar.subviews)
   {
      if ([view respondsToSelector:@selector(setHighLighted:)])
      {
         [view performSelector:@selector(setHighLighted:) withObject:[NSNumber numberWithBool:NO]];
      }  
   }
}


@end
  • 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-12T00:49:25+00:00Added an answer on June 12, 2026 at 12:49 am

    Finally got it to work:

    Category:

    @implementation UIToolbar (Additions)
    
    - (void)setHighlighted:(BOOL)highlighted
    {
        for (UIView *view in self.subviews)
        {
            for (UIView *subview in view.subviews)
            {
                if ([subview isKindOfClass:[UIButton class]])
                {
                    ((UIButton *)subview).highlighted = highlighted;
                }
            }
        }
    }
    
    @end
    

    Cell:

    - (void)setSelected: (BOOL)selected animated: (BOOL)animated
    {
        [super setSelected:selected animated:animated];
    
        [self.toolbar setHighlighted:NO];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an instance of UIToolbar that contains a UITextField inside. I'd like to
I have a UIScrollView that contains a UIToolbar, but when I scroll, the toolbar
I have a UIViewController that contains a subview and a UIToolbar. I'm trying to
I have a UIToolbar that I set up using IB with three buttons, left,
I have a View including a Toolbar and a WebView UIVIEW UIToolbar UIWebview Now
I have an application that requires synchronization and I wanted to inform the user
I have a UIToolbar that needs three buttons in a radio style, meaning that
I have a UIToolbar. If I create a UIBarButton like this, it works: UIBarButtonItem
I have a UINavigationController that has a UIToolbar on the bottom. Several of my
I have a UIToolBar with some button items on it separated by a flexible

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.