monotouch DialogViewController更改元素的顺序

时间:2012-02-29 13:02:44

标签: xamarin.ios monotouch.dialog

我目前正在使用Monotouch.Dialog中概述的高级编辑tableview,它允许用户删除以及编辑表格元素的标签。有没有办法丰富tableview以实现类似于屏幕截图的内容,即更改排序?

rearrange order of table elements

1 个答案:

答案 0 :(得分:4)

您需要将这两个方法添加到DialogViewController.Source

        public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath)
        {
            return true;
        }

        public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
        {
            tableView.MoveRow(sourceIndexPath,destinationIndexPath);
        }
相关问题