I have an UITableView
with a custom cell and a custom button for the entering the edit mode as well as a custom accessory button. Everything is working but I want the UIImageView
with two other UILabels
adjacent to it within the cell to be at its X position but only want the "ADD QTY" UILabel
to shift its X position to make room for the accessory button.
Asked
Active
Viewed 1,533 times
4

Surfer
- 1,370
- 3
- 19
- 34

Arjun Busani
- 550
- 1
- 7
- 15
-
You need to work on layoutsubviews method of your custom cell – Pooja M. Bohora Mar 27 '14 at 08:42
-
Don't subviews move in editing when they are added to the cells content view? Couldn't you just add everything apart from the quantity label to the cells view, and not content view? – Simon Mar 27 '14 at 08:59
1 Answers
8
If you don't want the contents of the UITableViewCell
to shift, implement the method
- tableView:shouldIndentWhileEditingRowAtIndexPath:
and make it return NO
. This method is a part of UITableViewDelegate
.
To make the ADD QTY move left, you will need to make a custom animation, I think. Animate the label for ADD QTY in this method
- tableView:willBeginEditingRowAtIndexPath:
There is a similar question here. Check it out and tell me if it works. Cheers!