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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:36:57+00:00 2026-05-27T02:36:57+00:00

If I set the backgroundColor attribute on a grouped UITableViewCell, the background color successfully

  • 0

If I set the backgroundColor attribute on a grouped UITableViewCell, the background color successfully changes. Great.

But I’d like to use UIAppearance to change the background color on all my UITableViewCells, so I can do it in one place and affect a change everywhere. Here’s my code:

[[UITableViewCell appearance] setBackgroundColor:[UIColor colorWithRed:30.0/255.0 green:30.0/255.0 blue:30.0/255.0 alpha:1.0]];

UITableViewCell implements UIAppearance and UIAppearanceContainer, so I would have thought this would work. But it doesn’t. I’ve also tried using -[UITableViewCell appearanceWhenContainedIn:(Class)], and that doesn’t work either.

Any ideas?

  • 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-27T02:36:57+00:00Added an answer on May 27, 2026 at 2:36 am

    Update (2013/7/8) – This has been fixed in newer versions of iOS. However, it’s worth knowing about if you’re targeting iOS 6 or below.

    You can blame Apple for this one, and it’s actually pretty mean of them. Technically, backgroundColor is not customizable through appearance proxies.

    From Apple’s documentation:

    To support appearance customization, a class must conform to the UIAppearanceContainer protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR.

    If we go into a class like UIBarButtonItem and look at the tintColor property we see this:

    @property(nonatomic,retain) UIColor *tintColor UI_APPEARANCE_SELECTOR;
    

    So because it’s marked with the UI_APPEARANCE_SELECTOR tag we know it works with UIAppearance.

    Here’s where Apple are particularly mean: in a UIView, backgroundColor has no appearance selector tag, but still works with UIAppearance. According to all the documentation Apple provide it should not, but yet it does!

    This gives the misleading impression that it will work for all sub-classes of UIView, including UITableView. This has come up before, in this previous SO answer

    So the bottom line is that backgroundColor shouldn’t work at all with UIAppearance, but for some reason it does on a UIView. It is not guaranteed to work on UIView subclasses, and it doesn’t work at all on UITableView. Sorry I couldn’t give you a more positive answer!

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

Sidebar

Related Questions

Removing Background color in Android I have set backgroundColor in code like this, View.setBackgroundColor(0xFFFF0000);
How can I set the background color of an HTML element using css in
How can I set the background color of a specific item in a System.Windows.Forms.ListBox
I want to set the background color of a label using HSV instead of
I tried to set the background color of a data grid view to be
I am trying to set the background color for a double spin box, and
Normally with Java Swing you can set the background color of a button with:
I have developed the application in which i want to set the background color
I am trying to set the row background color for the advanced data grid
I know how you can set an tag's url attribute programmatically in c#, but

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.