开发者

Triggering a move on an UITableView?

I have the following code in my DataSource class

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

pub开发者_如何学Clic override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
{
       ... code for swapping the location of stuff in a list
    }

How do I trigger a 'move'? If I swipe my UITableView I get my delete button, but how do I get a 'move'? Do I need to put a button and then put the table into a BeginEditting mode first? Any sample code for doing that?


In order to get the table to allow you to perform the move action, you need to set the table into "editing" mode ( tableView.Editing = true; ).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜