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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:28:48+00:00 2026-06-12T16:28:48+00:00

I have a simple Custom UITableViewCell in my project, and just added an Edit

  • 0

I have a simple Custom UITableViewCell in my project, and just added an Edit action to the table. Everything seems fine, but indentation is not working when editing, and edit Icons overlap the content. (Not to mention the delete button)

Indentation not working in custom cell

The custom cell is created in interface builder, with the standard constraints as usual and I have already tried to ovverride the layoutSubviews method in the class, as mentioned in other places with no luck as follows;

(void)layoutSubviews
{
[super layoutSubviews];
float indentPoints = self.indentationLevel * self.indentationWidth;

self.contentView.frame = CGRectMake(
                                    indentPoints,
                                    self.contentView.frame.origin.y,
                                    self.contentView.frame.size.width - indentPoints,
                                    self.contentView.frame.size.height
                                    );
}

I have also confirmed that the subviews are in fact within the contentView and everything seems fine in the View and Code.

Cell also has indentationLevel/Width set up programatically and autoresize masks to automatic width.

As a last resort I could create the UITableViewCell programatically, but don’t think it could help.

As per recommended, I have also made sure the Constraints on the Cell content to be fixed to the superview.

Fixed Margins on the left

Also manually set de autoResizingMasks in Code with no luck

—
Edit:

I have set the Background color of the contentView to black manually, and found that it is indenting correctly on edit mode, even without overriding the “layoutSubviews”. In fact, it works better that with it.

enter image description here

However, as you can see, the contents are not getting indented. Initially I tought the contents of the cell (UIImage) were not subviews of the contentView, but nslogging the subviews, show that they are.

NSLog(@"%@", self.contentView.subviews);

"<UIImageView: 0xa477030; frame = (23 7; 31 50); autoresize = TM+BM; userInteractionEnabled = NO; layer = <CALayer: 0xa477090>>"

I’m completely lost on why this keeps happening here. Must be some hidden constraint related to the iOS 6 new constraints stuff.

  • 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-12T16:28:49+00:00Added an answer on June 12, 2026 at 4:28 pm

    Indentation isn’t the same as adjusting the content view when entering edit mode.

    You’re right, this seems simple and usually works almost straight out of the box. Typically the only things you need to change are the autoresizing masks of the components you add to the cell. Content on the left should have a fixed left margin, content on the right should have a fixed right margin.

    When the cell enters editing mode the content view’s size is adjusted to allow room for the editing accessories. If your content has these resizing masks, it will move along with this. Your layoutSubviews method above is quite likely undoing all this by setting the content view back to full width because you are using indentation incorrectly – though I can’t be sure of that from the information in the question.

    UPDATE

    This is a issue (bug?) with constraints in UITableViewCells. You can go back to autoresizing masks by selecting the “File” tab in the storyboard / interface builder screen (if you want to use constraints elsewhere, use a standalone nib for the cell) and unchecking “Use Autolayout”:

    enter image description here

    This arranges your cell content properly.

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

Sidebar

Related Questions

I have a simple usercontrol that uses a simple custom panel where I just
I have a simple custom exception defined like like the following but I don't
I have a simple problem. I created a custom UITableViewCell that includes a UISwitch
I have created a simple C# custom action. [CustomAction] public static ActionResult MySimpleAction(Session session)
I have a simple custom NumberField: class NumberInput(forms.widgets.Input): input_type = 'number' class NumberField(forms.DecimalField): def
I have a simple custom view that is connected via outlet to a NIB.
i'm missing something fundamental here. i have a very simple custom class that draws
I have the following methods in my simple Custom Parser Class, when I execute
I have a simple form and would like to add a custom jQuery validation
I'm trying to create a custom component to extend PrimeFaces. I have a simple

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.