small medium large xlarge

Foto_5_pragsmall
09 Jun 2009, 06:08
Riccardo Canalicchio (3 posts)

I have a CATextLayer with wrapped property set to YES, and i put this layer inside a layer container with a default CAConstraintLayoutManager:

[CAConstraintLayoutManager layoutManager]

I set this constraints to the textlayer:

    [txtlayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX relativeTo:@"superlayer" attribute:kCAConstraintMinX]];
    [txtlayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX relativeTo:@"superlayer" attribute:kCAConstraintMaxX]];
    [txtlayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxY relativeTo:@"superlayer" attribute:kCAConstraintMaxY]];

Apple Documentation say that the CATextLayer only automatically resizes when a default CAConstraintLayoutManager is on, but it doesnt… How I make the textlayer resize his height to fit contents?

You must be logged in to comment