Я нахожусь на iOS 7, имею UITableViewController, с UITableView (связанным источником данных и делегатом) и пытаюсь использовать редактирование. Я использую пользовательский UITableViewCell с прототипом Dynamice в UIStoryboard. Когда я нажимаю на кнопку редактирования (self.editButtonItem), вы видите, что изменение имени завершено, но нет значков отступа (- значок). Прокручивание из ячейки работает, я получаю кнопку удаления.Пользовательский UITableViewCell не отображает отступ во время редактирования
Вот мой код:
self.navigationItem.leftBarButtonItem = self.editButtonItem;
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
Все мое содержание находится в contentView
Убедитесь, что пользовательский контент вашей ячейки был добавлен в контент contentView, а не непосредственно в ячейку. – rmaddy
Я добавил свой вопрос, посмотрю на картинку. –
Какой код у вас есть в кнопке редактирования? – rdelmar