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

  • Home
  • SEARCH
  • 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 644443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:23:29+00:00 2026-05-13T21:23:29+00:00

I have a UITableViewCell with the UITableViewStyleGrouped style and I would like to change

  • 0

I have a UITableViewCell with the UITableViewStyleGrouped style and I would like to change the background color of the cell.

- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)ip {
    // Do cell creation stuff ...

    cell.backgroundColor = 
      [UIColor colorWithRed:255.0/255.0 green:243.0/255.0 blue:175.0/255.0 alpha:0.50];
}

The trouble is, this doesn’t display properly on a grid with the UITableViewStyleGrouped; I use the same color on a UITableViewStylePlain and it displays correctly. I’m developing for OS 3.0 and have read the multiple posts on setting background color. I can set the color it just doesn’t set properly! What am I missing?

Incorrect yellow background with Alpha
Correct yellow background with Alpha

  • 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-13T21:23:30+00:00Added an answer on May 13, 2026 at 9:23 pm

    You must be doing something in your cell creation/reuse logic to change the default behavior. Starting a project from scratch and implementing this code works for me:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        }
    
        // Configure the cell.
        cell.backgroundColor = [UIColor colorWithRed:1.0 green:0 blue:0 alpha:1.0];
    
        return cell;
    }
    

    Double check the documentation if you need something more complex.

    Also, could the color shift be coming because of the different table background colors in the two different styles? A UITableViewStylePlain tableView has a default white background. A UITableViewStyleGrouped tableView will have a gray background. Since your are setting the alpha to 0.5, it will overlay onto two different color backgrounds and give you a color shift.

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

Sidebar

Related Questions

I have a custom UITableViewCell which fills the cell with a background PNG and
I have a UITableView cell that is going to have a variable size depending
I have a UITableViewCell with a method like this. -(void) setupStore:(StoreModel *) store {
In my app, I have a UITableViewCell which is used to display a background
In my application I have a UITextField inside a UITableViewCell . If I click
I have a UITableViewCell drawn using drawRect: . I'm drawing an shape in drawRect
I have a UITableViewCell that has an integrated UITextView. The goal is to make
I have a UITableViewCell (with associated UITableViewCell sub class, .m & .h) created in
I have a custom UITableViewCell with an image and UITextView property. The textview spans
I have a custom UITableViewCell set up with a MKMapView set up within the

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.