Opening a gap in NSTableView during drag and drop

前端 未结 4 1168
误落风尘
误落风尘 2021-01-30 11:52

I\'ve got a simple, single-column, view-based NSTableView with items in it that can be dragged to reorder them. During drag and drop, I\'d like to make it so that a gap for the

4条回答
  •  不知归路
    2021-01-30 12:09

    As of Mac OS X 10.9 (Mavericks), there's a much easier solution to animating drag & drop in a NSTableView:

    [aTableView setDraggingDestinationFeedbackStyle:NSTableViewDraggingDestinationFeedbackStyleGap];

    The table view will automatically insert gaps with animation as a row is dragged which is much nicer than the old blue line insertion point method.

提交回复
热议问题