CALayer doesn't resize immediately
CALayer doesn't resize immediately
- Subject: CALayer doesn't resize immediately
- From: Axel Péju <email@hidden>
- Date: Wed, 7 Nov 2007 10:58:54 +0100
Hi,
I've been experiencing some problems with Core Animation when resizing
a view containing CALayers. I've made a simple project that shows the
issue.
http://pacificturtle.free.fr/CoreAnimation.zip
Or here is the code:
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
rootLayer = [CALayer layer];
rootLayer.backgroundColor = [CAView color:C_BLACK];
rootLayer.layoutManager = [CAConstraintLayoutManager layoutManager];
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [CAView color:C_GRAY];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMinX
relativeTo:@"superlayer"
attribute:kCAConstraintMinX]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintWidth
relativeTo:@"superlayer"
attribute:kCAConstraintWidth]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintMidY
relativeTo:@"superlayer"
attribute:kCAConstraintMidY]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintHeight
relativeTo:@"superlayer"
attribute:kCAConstraintHeight]];
[rootLayer addSublayer:sublayer];
}
return self;
}
The rootLayer is filled with black and its sublayer is filled with
gray. This sublayer should resize itself to fill the rootLayer but
when I resize the window, it takes some time for the gray layer to
resize. Is this a bug or am I doing anything wrong ?
I am using a Powerbook G4 with a retail Leopard version.
Thanks
Axel
_______________________________________________
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