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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:05:52+00:00 2026-05-30T10:05:52+00:00

I have a UITableView in my project with rows being initialised as default UITableViewCell

  • 0

I have a UITableView in my project with rows being initialised as default UITableViewCell (the owner file is the delegate and the datasource for the table):

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }
    [cell setSelectionStyle:UITableViewCellSelectionStyleGray];
    switch (indexPath.row) {
        case 0:
            cell.imageView.image = [UIImage imageNamed:@"icon_facebook.png"];
            cell.textLabel.text = kShareFacebook;
            break;
        case 1:
            cell.imageView.image = [UIImage imageNamed:@"icon_twitter.png"];
            cell.textLabel.text = kShareTwitter;
            break;
        case 2:
            cell.imageView.image = [UIImage imageNamed:@"icon_clipboard.png"];
            cell.textLabel.text = kShareClipboard;
            break;
        default:
            break;

    }

    return cell;
}

This all works fine, however when the table is displayed, the images are shown on a darker background and there is a darker margin along the right edge of the rows, as can be seen in this image:
screenshot
I’ve tried to clear that background using a combination of some/all:

[cell setBackgroundColor:[UIColor whiteColor]];
[cell.imageView setBackgroundColor:[UIColor whiteColor]];
[cell setIndentationLevel:1];
[cell setOpaque:YES];

however this didn’t help a bit. How can I get rid of the dark background so that the entire cell appears on white background?

  • 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-30T10:05:53+00:00Added an answer on May 30, 2026 at 10:05 am

    This must have been one of iOS or, most likely, XCode’s fluckes. I deleted the table in IB and delete the corresponding code in my .m file. I then saved and closed the project and quit XCode.

    After opening XCode and the project, I open the ViewController in IB again and added the table again and set up all the delegates again. I added the code to set the overall table’s background to transparent (this can’t be done via IB, so I put that code in viewDidLoad method). I then rewrote the cellForRowAtIndexPath method (no copy-paste, just re-typed it – no problem, only about 10 lines anyway) and build the project.

    Lo and behold: the table was now displaying correctly. I hate spending days on some stupid bugs in the development tools.

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

Sidebar

Related Questions

I have a tableview method: - (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath that declares: NSInteger
I have a UITableView with reorderable rows and I'm using the standard UITableViewCell.text property
I have a UITableView populated with a location-based datasource. I'm calling [self updateView]; to
In my iPhone project I'm using a UITableview with UITableViewCells containing UITextfields. I have
I am working on a project that has a uitableview with 3 rows in
i have in my project UIViewcontroller with UITableview, and in every cell there is
I have an UITableView and I want to detect double touches on UITableViewCell. I
In my project I have a tableview with 20 custom tableviewcell; when I call
I have a project: first view is uitableview, when you select row uinavigationcontroller pushes
I have UITableView.when i click on it's 1 st row one another UITableView opens

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.