• 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
Re: CALayer doesn't resize immediately
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer doesn't resize immediately


  • Subject: Re: CALayer doesn't resize immediately
  • From: Thomas Schlömer <email@hidden>
  • Date: Wed, 7 Nov 2007 11:08:14 +0100

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: CALayer doesn't resize immediately
      • From: Axel Péju <email@hidden>
References: 
 >CALayer doesn't resize immediately (From: Axel Péju <email@hidden>)

  • Prev by Date: CALayer doesn't resize immediately
  • Next by Date: How to change input managers on Leopard
  • Previous by thread: CALayer doesn't resize immediately
  • Next by thread: Re: CALayer doesn't resize immediately
  • Index(es):
    • Date
    • Thread