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 UIView
no NO
. But NSView
doesn't have such a property. I tried experimenting with wantsLayer
, masksToBounds
, wantsDefaultClipping
, but all of these seem to only change the clipping of the drawRect
method, not the subviews.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- back button text does not change
- iOS (objective-c) compression_decode_buffer() retu
- how to find the index position of the ARRAY Where
相关文章
- 现在使用swift开发ios应用好还是swift?
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- didBeginContact:(SKPhysicsContact *)contact not in
- Custom Marker performance iOS, crash with result “
- Converting (u)int64_t to NSNumbers
For people looking for equivalent swift code:
Add this code to a subClass of NSView:
override var wantsDefaultClipping:Bool{return false}//avoids clipping the view
You don't have to change the parent. as long as the parent has a big enough clipping area. But its convenient to also add this variable to the parent.
Update 1:
This isnt an easy subject, ive spent weeks researching this and my best solution can be found here: http://stylekit.org/blog/2015/12/24/The-odd-case-of-luck/
Update 2:
To see the above concept in action check this article: http://stylekit.org/blog/2015/12/30/Graphic-framework-for-OSX/