In the image below, I swipe the cell to the left to reveal actions. Once the action is done, the cell adjusts back to normal... but not quite because the right side alignment is off. I'd like to get some ideas as to how to correct that behavior.
Here is a screenshot of it with the view debugger to outline the objects.
As you can see, the left hand side is still perfectly aligned. But the right hand side's trailing constraint is either disregarded (w/o telling me a constraint was broken) or some other thing is happening that I don't understand. The position of the button on the right varies from far off to only slightly off.
My actions are setup using tableView: editActionsForRowAtIndexPath:. Now, I get this scenario even if no action is taken and the user selects the part of the cell that isn't an action. However, within the actions I am also executing this line:
I tried to capture the value of the trailing constraint within the action, although I don't know if I am doing this correctly because the values came out the same.
FavoriteTableViewCell *cell = (FavoriteTableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath];
NSLog(@"Trailing Constraint before: %f)",cell.dragTrailingConstant.constant);
[self.tableView setEditing:NO animated:NO];
NSLog(@"Trailing Constraint after: %f)",cell.dragTrailingConstant.constant);
Trailing Constraint before: -4.000000
Trailing Constraint after: -4.000000
The trailing constraint is: Superview.Trailing.Margin Equal DragButton.Trailing. Constant -4. Priority 1000. Multiplier 1.
Aucun commentaire:
Enregistrer un commentaire