Re: Subview bounds resizing when frame resizes
Re: Subview bounds resizing when frame resizes
- Subject: Re: Subview bounds resizing when frame resizes
- From: Jens Alfke <email@hidden>
- Date: Sun, 2 Mar 2008 23:00:07 -0800
On 2 Mar '08, at 4:03 PM, Steve Weller wrote:
The subview bounds are set correctly at the start, but if I make the
subview's frame larger, the bounds are scaled larger too. I thought
from this in the NSView docs that the subview's bounds would stay
fixed:
Nope. Changing a view's frame does not change the scale factor of the
contents. 99% of the time that's what you want — resizing a button
shouldn't magnify its text! For the case where you do want the view's
contents to zoom as you resize it, you'll need to recompute the bounds
appropriately when the view's frame changes.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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