Iphone 在编辑过程中创建UITableViewCellAccessory

Iphone 在编辑过程中创建UITableViewCellAccessory,iphone,uitableview,Iphone,Uitableview,附件是iPhone配方核心数据源示例的屏幕截图 我试图在编辑期间在UITableViewCellAccessory位置重新显示三条水平线,但我看不到任何UITableViewCellAccessory样式会创建三条水平线。在编辑过程中,源代码将附件样式设置为UITableViewCellAccessoryStyleNone 你能给我一个如何创造这种效果的提示吗 三条水平线用于移动表格单元格。以下代码应使用tableView:canmoverowatinexpath方法为您启用它们: // Ove

附件是iPhone配方核心数据源示例的屏幕截图

我试图在编辑期间在UITableViewCellAccessory位置重新显示三条水平线,但我看不到任何UITableViewCellAccessory样式会创建三条水平线。在编辑过程中,源代码将附件样式设置为UITableViewCellAccessoryStyleNone

你能给我一个如何创造这种效果的提示吗


三条水平线用于移动表格单元格。以下代码应使用
tableView:canmoverowatinexpath
方法为您启用它们:

// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
     // Return NO if you do not want the item to be re-orderable.
     return YES;
}
您还应该实现
tableView:shouldinetwhileeditingrowatindexpath:
tableView:editingStyleForRowAtIndexPath:
以在单元格处于编辑模式时提供所需的样式和缩进。下面的大纲代码示例:

// Override to prevent/allow indentation of cells in editing mode
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}

// Select the editing style of each cell
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    // Do not allow inserts / deletes
    return UITableViewCellEditingStyleNone;
}
希望这有帮助;如果这是你要找的答案,请将其标记为正确