Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

While deleting a table row entire cell moves to leftside, how to avoid that?

I have MainStoryboard.storyboard file for all my views creation. In that, one of my view controller scene contains UITableView with 3 different UITableViewCells in it. Out of three, two are default UITableViewCell whereas one is CustomCell. Please find the same below:

For a default cell where text is displayed using cell.textLabel.text

(Image 1 :For a default cell where text is displayed using cell.textLabel.text)

For a custom cell where there is a custom cell class is implemented and UI is based upon storyboard design.

(Image 2 :For a custom cell where there is a custom cell class is implemented and UI is based upon storyboard design.)

But, while changing this tableview to edit mode, selecting minus sign for this cell, the cell does move to left side, hence the text in it, looks like it got cropped from left side. This happens only for iOS7 not in iOS6.

Please let me know what could be the solution for this.

like image 544
Mrunal Avatar asked Nov 12 '22 18:11

Mrunal


1 Answers

Need to set AutoLayout Constraints to label in custom cell,

To right side label in custom cell add Leading space to superview auto layout constraint.

Select Label in StoryBoard -> Editor -> pin -> Leading Space to SuperView.

like image 64
Savitha Avatar answered Nov 15 '22 07:11

Savitha