• 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: CTFrame and drawing text + layers.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CTFrame and drawing text + layers.


  • Subject: Re: CTFrame and drawing text + layers.
  • From: John Harper <email@hidden>
  • Date: Mon, 19 Nov 2007 10:49:48 -0800

You could try overriding the -preferredFrameSize method to something like this:

- (CGSize)preferredFrameSize
{
CGSize sz = CGSizeApplyAffineTransform ([self bounds].size, [self affineTransform]);
sz.width = ceil (sz.width); sz.height = ceil (sz.height);
return sz;
}


this will tell the layout manager that the text layer's ideal size is its current size. It may still get resized depending on how the parent's layout manager has been configured,

	John


On Nov 19, 2007, at 9:39 AM, John Clayton wrote:

Hi

I want to stop the CATextLayer from adjusting the boundaries of my text when I've got text wrapping turned on and the parent layer has a layout manager attached to it. I'd like the CATextLayer simply to use the boundaries that I provide it.

The docs state:
Note: When a CATextLayer instance is positioned using the CAConstraintLayoutManager Class Reference the bounds of the object is resized to fit the text content.


Is there a way of forcing it NOT to do this somehow? Something I can override perhaps?

--
John Clayton
http://www.coderage-software.com/



_______________________________________________

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

_______________________________________________

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: CTFrame and drawing text + layers.
      • From: John Clayton <email@hidden>
References: 
 >CTFrame and drawing text + layers. (From: John Clayton <email@hidden>)

  • Prev by Date: Re: Custom text via Core Text in a layer.
  • Next by Date: Re: Reordering CALayer sublayers without raping my performance?
  • Previous by thread: CTFrame and drawing text + layers.
  • Next by thread: Re: CTFrame and drawing text + layers.
  • Index(es):
    • Date
    • Thread