CALayer autoresizing difficulties
CALayer autoresizing difficulties
- Subject: CALayer autoresizing difficulties
- From: email@hidden
- Date: Tue, 30 Jul 2013 22:39:27 -0700
I am adding a special CALayer to the layer of my NSView. I can create my special CALayer, configure it, and add it the center of my NSView layer's heir-achy perfectly fine. However, as soon as I resize my main view, the special CALayer's bounds change. I specified the following autoresizing mask for my centered layer:
_playLayer = [PlayerButtons genericPlayButton];
[_playLayer setAutoresizingMask:kCALayerMinXMargin | kCALayerMaxXMargin | kCALayerMinYMargin | kCALayerMaxYMargin];
[_playLayer setPosition:CGPointMake(CGRectGetMidX([[self layer] frame]),
CGRectGetMidY([[self layer] frame]))];
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.
Patrick
_______________________________________________
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