【问题标题】:Reorder UITableView and hide reorder control重新排序 UITableView 并隐藏重新排序控件
【发布时间】:2012-03-02 07:34:06
【问题描述】:

我的问题是这样的:Reordering UITableView without reorder control,我使用这些方法:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath {
    return NO;
}
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    return YES;
}
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath{

}

[self.tableView setEditing:YES];

......

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    ItemTableViewCell *cell = (ItemTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ItemTableViewCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    // ...
    cell.showsReorderControl = NO;
    return cell;
}

参考:reordering control in UITableView

结果是表格可以重新排序,但重新排序控件永远不会隐藏。所以我想知道我是否错了,或者是否有人可以帮助我?谢谢。

【问题讨论】:

    标签: ios uitableview


    【解决方案1】:

    查看此网址:Reordering a UITableViewCell from any Touch point。这可能对您有所帮助

    【讨论】:

    • 我可以建议尝试BVReorderTableView吗?它提供了一个更简洁的解决方案,而不是破解 UITableView 单元子视图。
    • 死链接。应该发布正确的答案以避免这种情况。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-03
    • 1970-01-01
    • 2015-01-27
    • 1970-01-01
    • 2013-01-15
    • 1970-01-01
    相关资源
    最近更新 更多