FROM : Thomas Schlömer
DATE : Wed Nov 07 11:08:14 2007
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
DATE : Wed Nov 07 11:08:14 2007
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
| Related mails | Author | Date |
|---|---|---|
| Axel Péju | Nov 7, 10:58 | |
| Thomas Schlömer | Nov 7, 11:08 | |
| Axel Péju | Nov 7, 21:52 | |
| Bertrand Landry-He… | Nov 8, 12:42 | |
| Scott Anguish | Nov 8, 23:11 | |
| Scott Anguish | Nov 8, 23:11 | |
| Bertrand Landry-He… | Nov 11, 09:17 |






Cocoa mail archive

