• 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
Smooth resizing of a text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Smooth resizing of a text field


  • Subject: Smooth resizing of a text field
  • From: Craig Mason-Jones <email@hidden>
  • Date: Thu, 21 Jul 2011 11:40:52 +0900

Don't fiddle with the individual properties of the subviews in the window.
Rather, just apply a scaling transform to the entire window, and let Core
Graphics take care of the rest. i.e. do what you really mean to do: scale
everything.

Unfortunately I've just upgraded to Lion ( :-) ) so I'm now busy installing
the upgraded XCode, so I can't write a quick demo. You need to look at the
NSView's layer property, which gives a CALayer, which has a
-(void)setAffineTransform:(CGAffineTransform) method.

Create the transform using the CGAffineTransformScale(CGFloat sx, CGFloat
sy) method.

Good luck!
C
_______________________________________________

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

  • Prev by Date: "Nested" runloops
  • Next by Date: Cocoaheads- Silicon Valley July Meeting
  • Previous by thread: Re: standardDefaults
  • Next by thread: Number Strings to NSDecimalNumber
  • Index(es):
    • Date
    • Thread