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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:17:40+00:00 2026-05-24T08:17:40+00:00

I have problem with the cell background color becoming clearcolor always. I set the

  • 0

I have problem with the cell background color becoming clearcolor always. I set the uiview background color to gray color, tableview background color to clear color and I did not set tableviewcell background color to clear color. But the cell background always appears grey. Can any one have any idea about this.

Thanks

enter image description here

-(void)viewDidLoad
{
    self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"TableBackGround.png"]];

    Acc_Details_TView.backgroundColor = [UIColor clearColor];
    Acc_Details_TView.rowHeight = 40;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"TransCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    switch ([Acc_Details_SegCtrl selectedSegmentIndex]) {
        case 0:{
            if (cell == nil) {
                cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"TableCell"] autorelease];
                cell.backgroundColor =[UIColor clearColor];
                cell.textLabel.font = [UIFont boldSystemFontOfSize:14];
                cell.detailTextLabel.text = [[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Date"];
                cell.detailTextLabel.font = [UIFont systemFontOfSize:12];
            }
            NSString *titleName =[[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Title"] ;
            if ([titleName length] > 19) {
                cell.textLabel.text = [titleName substringWithRange:NSMakeRange(0, 20)];                
            }
            else{
                cell.textLabel.text = titleName;
            }

            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
            UILabel * acc_Amount = [[UILabel alloc] initWithFrame:CGRectMake(220, 5, 60,10)];
            acc_Amount.textAlignment = UITextAlignmentRight;
            acc_Amount.backgroundColor = [UIColor clearColor];
            acc_Amount.text = [[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Amount"];
            acc_Amount.font = [UIFont boldSystemFontOfSize:14];
            [cell.contentView addSubview:acc_Amount];
            UILabel * balance_Amount = [[UILabel alloc] initWithFrame:CGRectMake(220, 23, 60,10)];
            balance_Amount.textAlignment = UITextAlignmentRight;
            balance_Amount.text = @"$1234.50";
            balance_Amount.backgroundColor = [UIColor clearColor];
            balance_Amount.textColor = [UIColor grayColor];
            balance_Amount.font = [UIFont systemFontOfSize:12];
            [cell.contentView addSubview:balance_Amount];
            return cell;            
        }
    }
}
  • 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-24T08:17:41+00:00Added an answer on May 24, 2026 at 8:17 am

    Your cells are not exactly transparent. Setting UITableView’s backgroundColor does some crazy undocumented stuff. Best way to see this is to set it to some semi-transparent color like [UIColor colorWithWhite:0.5 alpha:0.5] by which you get something like this:

    weird table view

    To fix your problem, you will have to set cells’ contentView.backgroundColor and backgroundColors of all the subviews after setting tableView’s. Here is your cellForRowAtIndexPath: updated with this:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"TransCell";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        UIColor *cellBackgroundColor = [UIColor whiteColor];
    
        switch ([Acc_Details_SegCtrl selectedSegmentIndex]) {
            case 0:{
                if (cell == nil) {
                    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"TableCell"] autorelease];
                    cell.textLabel.font = [UIFont boldSystemFontOfSize:14];
                    cell.detailTextLabel.text = [[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Date"];
                    cell.detailTextLabel.font = [UIFont systemFontOfSize:12];
                    cell.accessoryView.backgroundColor = cellBackgroundColor;
                    cell.backgroundView.backgroundColor = cellBackgroundColor;
                    cell.contentView.backgroundColor = cellBackgroundColor;
                    cell.textLabel.backgroundColor = cellBackgroundColor;
                    cell.detailTextLabel.backgroundColor = cellBackgroundColor;
                    UIView *backView = [[UIView alloc] initWithFrame:cell.frame];
                    backView.backgroundColor = cellBackgroundColor;
                    cell.backgroundView = backView;
                    [backView release];
                }
                NSString *titleName =[[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Title"] ;
                if ([titleName length] > 19) {
                    cell.textLabel.text = [titleName substringWithRange:NSMakeRange(0, 20)];                
                }
                else{
                    cell.textLabel.text = titleName;
                }
    
                cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
                UILabel * acc_Amount = [[UILabel alloc] initWithFrame:CGRectMake(220, 5, 60,10)];
                acc_Amount.textAlignment = UITextAlignmentRight;
                acc_Amount.backgroundColor = cellBackgroundColor;
                acc_Amount.text = [[transcationsList objectAtIndex:([indexPath row])] valueForKey:@"Amount"];
                acc_Amount.font = [UIFont boldSystemFontOfSize:14];
                [cell.contentView addSubview:acc_Amount];
                UILabel * balance_Amount = [[UILabel alloc] initWithFrame:CGRectMake(220, 23, 60,10)];
                balance_Amount.textAlignment = UITextAlignmentRight;
                balance_Amount.text = @"$1234.50";
                balance_Amount.backgroundColor = cellBackgroundColor];
                balance_Amount.textColor = [UIColor grayColor];
                balance_Amount.font = [UIFont systemFontOfSize:12];
                [cell.contentView addSubview:balance_Amount];
            }
        }
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table cell in which i have to set a background image,
I have a problem using the following code to set background of UITAbleview. Can
I have a problem customizing my AQGridViewCell. I'd like to have the whole cell
i have problem with autorotate on iphone i set up in all classes -
I have problem with cakephp's Session->write method. If I set a value like $_SESSION['..']
Using the variables extension, I want to change the background color of a cell
I have a large table which has a background-color on each td. I also
I have a problem setting the CSS class for each cell in a given
I'm having a problem. I have a Custom UITableViewCel, the cell contains a slider
I have a problem with stretchable images in my tableView. Until Today I used

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.