Arjun Busani
Arjun Busani

Reputation: 550

UITableView edit mode shifting of cell

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.

Tableview upon entering edit mode.

Upvotes: 4

Views: 1540

Answers (1)

aksh1t
aksh1t

Reputation: 5448

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!

Upvotes: 8

Related Questions