Re: CALayer autoresizing difficulties
Re: CALayer autoresizing difficulties
- Subject: Re: CALayer autoresizing difficulties
- From: Andreas Mayer <email@hidden>
- Date: Wed, 31 Jul 2013 18:07:02 +0200
Am 31.07.2013 um 07:39 schrieb email@hidden:
> [_playLayer setAutoresizingMask:kCALayerMinXMargin | kCALayerMaxXMargin | kCALayerMinYMargin | kCALayerMaxYMargin];
> According to this code, the CALayer should be centered, and as the NSView's bounds change, the CALayer's frame should adjust to stay centered in the view while the layer's bounds don't change. However, my special CALayer's bounds grow as I expand my main view.
I think it works exactly the opposite way.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/WorkingWithAViewHierarchy.html#//apple_ref/doc/uid/TP40002978-CH4-SW12
(This is about views, not layers. But I'm pretty sure they didn't invert the logic for layers only.)
-------
NSViewWidthSizable
If set, the view's width changes proportionally to the change in the superview's width. Otherwise, the view's width does not change relative to the superview's width.
-------
Which makes sense since kCALayerNotSizable is zero.
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden