NSOutlineView spring loading exits over NSImageView but not NSButton

最后都变了- 提交于 2019-12-18 09:52:09

问题


I have an NSOutlineView subclass that implements the NSSpringLoadingDestination.

The outline view is populated with NSTableCellViews. Each table cell view has an NSTextField and NSImageView. It looks just like the name column in the Finder window: icon and text.

When I drag a row over the text field in another row everything works fine. When the cursor goes over the NSImageView, however, the spring loading exits.

The outline view also loses the highlight for that row.

If I replace the image view with an NSButton containing the image, the spring loading does not exit. And the outline view maintains the highlight.

Can anyone tell me why an NSControl does not interrupt the spring loading but an NSImageView does?

I have tried overriding some different NSView methods but I can’t get the image view to behave like the button.

Thanks.


回答1:


Even when an image view is uneditable it apparently still handles drag & drop. To fix this call the image view's unregisterDraggedTypes method.



来源:https://stackoverflow.com/questions/48014975/nsoutlineview-spring-loading-exits-over-nsimageview-but-not-nsbutton

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!