MinnuKaAnae
MinnuKaAnae

Reputation: 1646

UITableView edit mode delete button is hiding in IPhone 4s

Delete button is not fully visible in smaller resolutions.

func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
    return true
}

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
    if (editingStyle == UITableViewCellEditingStyle.delete) {
    }
}

Below is my screenshot

enter image description here

Update 1

Screenshot for tableview cell constraints

enter image description here

Upvotes: 3

Views: 216

Answers (1)

Fogmeister
Fogmeister

Reputation: 77641

OK, so from your comment your table view is not constrained to the view properly. So your cells are "hanging" off the right edge of the screen.

To fix this you should add constraints in your storyboard.

Select the table view and hit the add constraints button. Select the four edges and put 0 in the box.

Then hit "add constraints" this should fix the problem you are having.

The add constraints button is the one that looks like a Star Wars Tie Fighter in the bottom right corner of the Interface Builder screen...

enter image description here

Upvotes: 1

Related Questions