Make the divider of an NSSplitView undraggable and don't show the dragging cursor

前端 未结 2 829
失恋的感觉
失恋的感觉 2021-02-01 22:11

I have an NSSplitView (NO UISplitView(Controller)!!) with three subviews. Now, for the last divider (index 1), I want the divider to not show the d

2条回答
  •  误落风尘
    2021-02-01 22:35

    I know this has been answered for a while, but the supplied answer did not suit my needs.

    The delegate method splitView:effectiveRect:forDrawnRect:ofDividerAtIndex: allows you to set the effective rectangle for dragging the divider. If you return NSZeroRect no drag cursor will ever appear, regardless of your setup in splitView:constrainMaxCoordinate:ofSubviewAt: and splitView:constrainMinCoordinate:ofSubviewAt:.

    Hope that helps someone else who lands here.

提交回复
热议问题