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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:24:30+00:00 2026-06-04T03:24:30+00:00

I am trying to add a background image to UITableViewCell using the following code:

  • 0

I am trying to add a background image to UITableViewCell using the following code:

UIImage *bgImage=[UIImage imageNamed:@"green-cell-row.png"];
UIImageView *bgForFirst=[[UIImageView alloc] initWithImage:bgImage];
cell.backgroundView=bgForFirst;
[cell.contentView addSubview:venueDisplayImage];
[cell.contentView addSubview:venueDisplayName1];
[cell.contentView addSubview:venueDisplayName2];
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
cell.selectionStyle = UITableViewCellSelectionStyleGray;

However, I get venueDisplayName on white space around it. What would be the best way to fix this and correctly add my background image?

  • 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-06-04T03:24:31+00:00Added an answer on June 4, 2026 at 3:24 am

    Try this way:

    1) TabelView set the background like:

    tblView.backgroundView.alpha = 0.0;
    tblView.backgroundColor=[UIColor clearColor];
    

    2) Add the image view in cellForRowAtIndexPath og delegate method of tableview:

    UIImageView *bckView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, 300,80)];
    cell.backgroundView.alpha = 0.0;
    cell.backgroundColor=[UIColor clearColor];
    bckView.image = [UIImage imageNamed:@"cell.png"];
    bckView.contentMode = UIViewContentModeScaleToFill;
    [cell.contentView addSubview:bckView];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add a background image to a view. The image is
Hi I am trying to add background image to my link. The image contains
This is what I'm trying to do: I have a .png image as background
Im trying to add a centered background image behind a JTable in a JScrollPane.
I am trying to add a custom image to a checkbox and I'm using
I am trying to add a background image to a listActivity in my app.
I'm trying to add table rows programmatically following the code here /* Find Tablelayout
I'm trying to add a gradient to the background of a LinearLayout, and it
I'm trying to add an overlay to a MapView from a background thread to
Trying to add a class object into a List using reflection, but when invoking

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.