Smooth resizing of a text field
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