5

我有一个 NSTableView 并且我已经成功地实现了tableView:validateDrop:proposedRow:proposedDropOperation:tableView:acceptDrop:row:dropOperation:.

我不需要tableView:writeRowsWithIndexes:toPasteboard:,因为那是为了将对象拖出 NSTableView。

现在,问题是我希望它的行为类似于 iTunes。在 iTunes 9.x 中(我不记得以前的版本)你有一个 NSTableView (播放列表),当你在它上面拖动一个文件时,你会在 NSTableView 中得到这个蓝色焦点(也许是 NSScrollView?),你没有蓝色水平线指示您要插入对象的位置。所以基本上我想:

  • 将文件悬停在 NSTableView 上时,行之间没有蓝色水平插入线。

  • NSTableView(或 NSScrollView)内的蓝色焦点。

任何帮助将不胜感激,因此在此先感谢您。

4

1 回答 1

7

From the NSTableView reference:

- (void)setDropRow:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation

....

"Passing a value of –1 for row, and NSTableViewDropOn as the operation causes the entire table view to be highlighted rather than a specific row. This is useful if the data displayed by the receiver does not allow the user to drop items at a specific row location"

于 2010-02-06T11:47:15.133 回答