• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CALayer doesn't resize immediately
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CALayer doesn't resize immediately
      • From: Thomas Schlömer <email@hidden>
  • Prev by Date: Re: Network programming...
  • Next by Date: Re: CALayer doesn't resize immediately
  • Previous by thread: Re: Cocoa Python broken in Leopard??
  • Next by thread: Re: CALayer doesn't resize immediately
  • Index(es):
    • Date
    • Thread