Make NSView NOT clip subviews outside of its bounds

后端 未结 6 1176
感动是毒
感动是毒 2020-12-13 19:30

Is it possible to make an NSView not clip its subviews that are outside of the bounds? On iOS I would simply set clipsToBounds of my

6条回答
  •  臣服心动
    2020-12-13 20:08

    The behaviour around this seems to have changed. You just need to set the view's layer to not mask to bounds.

    view.wantsLayer = true
    view.layer?.masksToBounds = false
    

提交回复
热议问题