I have a UITableView with some cells that will have a disclosure indicator (UITableViewCellAccessoryDisclosureIndicator) and some which will not (UITableViewCellAccessoryNone). I’m setting this in the cellForRowAtIndexPath method, based on my data values for the table rows. My problem is that I have some right-aligned labels in the cells that should all line up regardless of whether the indicator is displayed or not, and I’m finding that the indicator arrow pushes my labels out of align, as if it has a fixed margin. Is there any way to prevent this happening, without having to programatically reposition my UILabels? My UITableView is designed in Interface Builder with prototype cells if that makes any difference. My app is targetting iOS 5.1.

Adding a
UITableViewCellAccessoryDisclosureIndicatorwill shrink the space allotted for your cell’s contentView.You either have to create your own disclosure indicator as an image subview or you need to fix the constraints on the label(s) with the numbers.
Or instead of using the cell’s textLabel for the numbers and then right align it, you could setup up own
UILabelwhich you add to the cell’s contentView. For the UILabel subview you make sure it does not extend beyond the cell’s width as if it had a disclosure indicator. You can set the background colour of your UILabel to red or something which will help you align the labels correctly.