• 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
NSView autoresizing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSView autoresizing


  • Subject: NSView autoresizing
  • From: "Cathy Shive" <email@hidden>
  • Date: Tue, 3 Apr 2007 17:04:59 -0400

Hello,

I am having some trouble with autoresizing my NSView.

I have a window with a single NSView subclass that I created by
dragging a CustomView from the IB Pallette Window.  I want the view,
myCustomView, to keep it's original width and height but to stay
centered in the window when the window is resized.  To do this, I can
either set the autoresizing mask in IB by placing springs around each
side or I can set it programmatically with the following code:

[myCustomView  setAutoresizingMask: NSViewMinYMargin |
NSViewMaxYMargin |NSViewMinXMargin | NSViewMaxYMargin];

Either way, I get the same behavior.  The view stays centered until i
resize the window smaller than the view.  Then, when I expand the
window again, the view becomes stuck to one of the window's sides.  If
I repeat this action over and over, the view will unstick and stick to
different sides of the window.

I can correct this behavior by overriding the
-(void)resizeWithOldSuperviewSize: method in my custsom view, but I'd
like to understand why it's happening in the first place.

Any thoughts?

Thanks,
Cathy
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSView autoresizing
      • From: Andy Lee <email@hidden>
    • Re: NSView autoresizing
      • From: "Cathy Shive" <email@hidden>
  • Prev by Date: dynamically adding value transformer
  • Next by Date: Re: NSView autoresizing
  • Previous by thread: dynamically adding value transformer
  • Next by thread: Re: NSView autoresizing
  • Index(es):
    • Date
    • Thread