Re: CALayer doesn't resize immediately
Subject : Re: CALayer doesn't resize immediately
From: Axel Péju <email@hidden >
Date: Wed, 7 Nov 2007 21:52:18 +0100
Delivered-to: email@hidden
Delivered-to: email@hidden
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=EKFhGSGsH4IMVf7j/zI95g/Tc1cPP4OMBeH6cGCQDr4=; b=BzFbgjZMUxdJ4oqUK6X0QlbnEOcqEHFBdwTFkW12N783bCWCJLK+wLMrG/swWvwlczEX0Kx/5a8x6PXxgVCaLDQNYG0J0Sl3nRZ1lqP6mZalR0y7QsQJpMI0IisnYmVZXZn/vf3bkbaU9QmliMWOW6YkxW9bfqaCB8909zOx1h4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=HAIIapEVSwqO9sBjikNAQpTArgTeharsx7iTki6f05VZL8Iw+nJpZAA0OCxYilNpOdCMxE0RMxXDK0HcAHW0+UZpFQ2aGlDrDWL5aXU78YLl1gDKHVB0fUvNIIosV+Ife0fc1fxZHRkyekIjC8IMOGxM9HIC3SxmyMRBj5UazaQ=
Hi again,
Using autoresizingMaks works far better. But after some hours of work,
I came with the conclusion that CAConstraintLayoutManager performances
are not what I expect them to be. Even with the Core Animation
provided - CovertFlow - example, I clearly see the layers translate
when I resize the view.
The problem is that I really need to use CAConstrainLayoutManagers,as
my application does more than the project I included in the first mail.
Maybe some of you could confirm this issue, it might be a PPC-only
issue. I hope there is a fix in 10.5.1 if this is a bug...
Axel
Le 7 nov. 07 à 11:08, Thomas Schlömer a écrit :
Hi,
my first guess:
Instead of configuring the constraints like this
[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]];
it should be sufficient to write
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintWidth
relativeTo:@"superlayer"
attribute:kCAConstraintWidth]];
[sublayer addConstraint:[CAConstraint
constraintWithAttribute:kCAConstraintHeight
relativeTo:@"superlayer"
attribute:kCAConstraintHeight]];}
, i.e., just constraining the width and height in relation to the
superlayer.
However, a more elegant solution should be to simply write:
sublayer.autoresizingMask = kCALayerWidthSizable |
kCALayerHeightSizable;
sublayer.layoutManager = [CAConstraintLayoutManager layoutManager];
All this without actually testing it.
Thomas S.
--
Oldenburg University - Department of Computer Science
Media Informatics and Multimedia-Systems
Phone: +49 441 9722-175 - Fax: +49 441 9722-102
Escherweg 2 - D-26121 Oldenburg
_______________________________________________
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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.