• 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: Strange resizing issue with NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange resizing issue with NSView


  • Subject: Re: Strange resizing issue with NSView
  • From: John Stiles <email@hidden>
  • Date: Mon, 30 Jan 2006 22:25:54 -0800

Thanks for the clarification, guys. Unless I'm completely mistaken, it looks like I have a bona-fide NSView bug on my hands :) I have written a little test app which demonstrates this issue and filed it as rdar://4427606 .


Scott Anguish wrote:

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


References: 
 >Strange resizing issue with NSView (From: John Stiles <email@hidden>)
 >Re: Strange resizing issue with NSView (From: Daniel Jalkut <email@hidden>)
 >Re: Strange resizing issue with NSView (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Strange resizing issue with NSView
  • Next by Date: Re: Fake NSMenu-like view
  • Previous by thread: Re: Strange resizing issue with NSView
  • Next by thread: NSearchField IB Predicates
  • Index(es):
    • Date
    • Thread