我正在删除具有 UIImage 视图的 UITableView 中的单元格。当我滑动删除时,删除按钮在 UIView 后面,如果 UIView 在删除按钮后面会更好看。有没有办法可以将按钮的图层首选项设置在顶部?
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
[context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];
//Deletes view from cell
for (UIView *subview in [self.view subviews]) {
if (subview != self.tableView) {
[subview removeFromSuperview];
}
}
NSError *error = nil;
if (![context save:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
}
[self performFetch];
}