Sibling NSView z-ordering in Cocoa

↘锁芯ラ 提交于 2019-12-05 19:29:27
Johannes Fahrenkrug

Yes, NSView siblings are allowed to overlap, the Apple docs are out of date: Are layer-backed NSView siblings allowed to overlap?

Also, the z-order depends on the order of the subviews in the parent view's subviews array.

I've been solving the same issue and found that at least on Mavericks it works only with layer backed views. I didn't have chance so far to test it on other OS X versions, but on Mavericks you have to set wantsLayer to YES on all views you want to overlap in order to make it work.

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