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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:10:35+00:00 2026-05-27T17:10:35+00:00

Currently I am setting the background Image (UIImageView) in each UITableViewCell in the cellforrowatindex

  • 0

Currently I am setting the background Image (UIImageView) in each UITableViewCell in the cellforrowatindex path.

This is how I set it:

if (indexPath.row%2) {
        cell.backgroundImage.image = [UIImage imageNamed:@"Image1.png"];
    }
    else {
        cell.backgroundImage.image = [UIImage imageNamed:@"Image2.png"];
    }

The problem is, when I edit it by doing setEditing: there is a white space on the left side where the red circle button is which I do not want. I want it to continue being either Image1 or Image 2 in that area that comes in from the left when starting to edit.

How can I modify my code to do that?

Thanks!

  • 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-27T17:10:36+00:00Added an answer on May 27, 2026 at 5:10 pm

    If your tableview is grouped you can use

    @property(nonatomic) BOOL shouldIndentWhileEditing
    

    if not the other option I know of is to take your background for a cells 1 & 2 and create one resizable image that tiles with

    - (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets
    

    and use that as your tableview background. capInsets would of course be all zero.

    UIImage *tableBackground =[[UIImage imageNamed:@"cell_1_2"] 
                                   resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    

    If your cells are standard height make a new image in photoshop that is a combination of your cell1 & cell2 background that you want to alternate down the table, 320×88 and call it ‘cell_1_2’. Then use that as your tableview background, and it will be tiled/repeat the length of your tableview. The only problem would be if the number of cells in the table didn’t take up the height of the screen, the background image would still tile to the bottom of the view. So it may not be the best solution.

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

Sidebar

Related Questions

Currently I am setting the background on each Grid row individually: <Grid> <Grid.RowDefinitions><RowDefinition /><RowDefinition
I want to set a background image of UIToolbar in my iPhone application. Currently
I'm currently in the process of setting my website, largely with php. Though this
I am setting the background-image of some elements using css (some elements have no
In my iPad app I currently have a background image png of 1024x1024 pixels
I have a div which currently has a static background image. I need to
I am currently using this code in my App Delegate to set a custom
We are currently setting up the evaluation criteria for a trade study we will
I'm currently setting up a new production environment for a Rails application which includes
I'm currently setting up CI for my project and have team city configure and

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.