Re: Strange resizing issue with NSView
Re: Strange resizing issue with NSView
- Subject: Re: Strange resizing issue with NSView
- From: Scott Anguish <email@hidden>
- Date: Tue, 31 Jan 2006 00:24:05 -0500
On Jan 30, 2006, at 8:23 PM, Daniel Jalkut wrote:
John - I have noticed some funny behavior with IB and autosizing
views. In particular, I think what I observed was that if for
instance a nib is saved with an empty window, the
"setAutoresizesSubviews" property of the window's contentView gets
archived as NO.
With the skepticism I've earned from that experience, I wouldn't be
surprised if there were other scenarios in which a nib ends up
getting saved with that property unexpectedly set to NO. Maybe an
optimization attempt on the part of IB.
this is in some forthcoming doc... the second para is applicable to
your observation.
When one of these mask flags is omitted, the view's layout is fixed
in that aspect; when the flag is
included the view's layout is flexible in that aspect. For example,
to keep a view in the lower-left
corner of its superview, you specify NSViewMaxXMargin |
NSViewMaxYMargin. When more than one
aspect along an axis is made flexible, the resize amount is
distributed evenly among them.
Autoresizing is on by default for views created using initWithFrame:,
but you can turn it off using
the setAutoresizesSubviews: method. However, if the view is created
in Interface Builder and no
autoresizing flags are set in the view's inspector, then
setAutoresizesSubviews: is automatically
set to NO. Before programmatically modifying the autoresizing mask
you need to explicitly enable
autoresizing for the superview.
When you turn off a view's autoresizing, all of its descendants are
likewise shielded from changes in
the superview. Changes to subviews, however, can still percolate
downward. Similarly, if a subview
has no autoresize mask, it won’t change in size, and therefore none
of its subviews autoresize. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden