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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:18:47+00:00 2026-05-26T07:18:47+00:00

I have a custom grouped UITableViewCell, with a couple of UILabels on it. Since

  • 0

I have a custom grouped UITableViewCell, with a couple of UILabels on it. Since the UITableViewCell background color used to be pure white, it matched the UILabels’ default background color, so the UILabel box wasn’t visible..

After updating to iOS 5.0, I notice that now the default background color for grouped UITableViewCells is a more greyish white (actually #f7f7f7), and as a consequence the UILabels’ frame is visible in an ugly way..

So, what is the best way to set the UILabels’ background color when it needs to vary between different iOS versions? I know I could use opaque = NO and [UIColor clearColor], but I would prefer to paint the UILabels’ background for performance reasons.

  • 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-26T07:18:47+00:00Added an answer on May 26, 2026 at 7:18 am

    In the delegate method tableView:willDisplayCell:, the UITableViewCell will have the background colour set to white or, in iOS 5, greyish.

    You can change all your the backgroundColor of all your subviews.

    - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
        for (UIView* view in cell.contentView.subviews) {
            view.backgroundColor = cell.backgroundColor;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grouped UITableView with a custom UITableViewCell class and I am adding
I have a grouped UITableView with custom cells (created by subclassing UITableViewCell ). I
I have custom background for my standard view and my grouped uitableview which I
I have a grouped table view and I have added a custom background view,
I have custom UITableViewCell . It contains UITextLabel . When I press this cell
I have custom UITableViewCell s as well as headers and footers. Each of them
I have a custom UITableViewCell nib that has an image on the left side
The grouped UITableViewCell uses tableCellGroupedBackgroundColor color instead of regular whiteColor color, in iOS 5.
I have a grouped table view with custom cells (created programmatically by subclassing, not
I have a plain (not grouped) tableView with custom cells, and when I hit

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.