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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:51:27+00:00 2026-05-21T17:51:27+00:00

UITableViewCell modifies the contents of it’s contentView hierarchy when the cell is is highlighted

  • 0

UITableViewCell modifies the contents of it’s contentView hierarchy when the cell is is highlighted (user touches down on the cell).

Two examples I’ve found to date:

  • Put a UIView in a cell’s contentView with a background color. That UIView’s background color is removed when the table cell is highlighted (it’s apparently set to have a clear background.)
  • Put a UIButton in contentView. When the cell is highlighted, the button is also forced into the highlighted state.

It’s as if there’s some logic in the UITableView cell that inspects all views in the cell’s hierarchy and modifies them according to a set of mysterious rules, then restores them back to normal once the cell is un-highlighted.

Can anyone explain what and why UITableViewCell is modifying (unexpectedly and in an undocumented fashion) in the contents of my custom table view cells?

Thanks!

  • 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-21T17:51:27+00:00Added an answer on May 21, 2026 at 5:51 pm

    The highlighting of the UITableViewCell is documented in the Apple docs as follows:

    The highlighting affects the
    appearance of labels, image, and
    background. When the the highlighted
    state of a cell is set to YES, labels
    are drawn in their highlighted text
    color (default is white). The default
    value is is NO. If you set the
    highlighted state to YES through this
    property, the transition to the new
    state appearance is not animated. For
    animated highlighted-state
    transitions, see the
    setHighlighted:animated: method.

    Note that for highlighting to work
    properly, you must fetch the cell’s
    labels using the textLabel and
    detailTextLabel properties and set
    each label’s highlightedTextColor
    property; for images, get the cell’s
    image using the imageView property and
    set the UIImageView object’s
    highlightedImage property.

    This does not mention UIButtons, but this post is about how to prevent the button from going into the highlighted state when the cell does.

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

Sidebar

Related Questions

A UITableViewCell reflects two distinct states: Highlighted and Selected. For me, they sound identical
UITableViewCell *cell = [tableViewController.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]]; [cell setFrame:CGRectMake(cell.frame.origin.x, cell.frame.origin.y - 34, cell.frame.size.width, cell.frame.size.height)];
Two UITableViewCell related questions: In my custom UITableViewCell I loop through an array (of
I have custom UITableViewCell . It contains UITextLabel . When I press this cell
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellId]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@ThemeCell owner:self
I've subclassed UITableViewCell to display a UIImage and two UILabel subviews. In the view
This is my cellForRowAtIndexPath UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) {
I have customized uitableViewcell in which each cell show four data which are related
I have subclassed UITableViewCell to make a custom cell for a tableView. I add
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc]

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.