• 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: Hiding a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hiding a view


  • Subject: Re: Hiding a view
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Thu, 25 Oct 2001 13:07:55 -0200

From: Ondra Cada <email@hidden>
Date: Thu, 25 Oct 2001 11:45:41 +0100

Dustin Mierau (DM) wrote at Thu, 25 Oct 2001 00:17:15 -0700:
DM> This is probably a stupid question, how do I hide a subview? I
DM> can't actually find a method to "hide" an NSVIew.

Move it well outside its superview (eg. set its origina to [100000,origy] or so).

Moving up and/or to the left seems to be better... moving down or to the right as in your example apparently may move the view when the window is resized... be prepared to recalculate the view's origin to move it back, and not depend on where it was or on where you left it.

I couldn't find this caveat in TFM, BTW :-)

A somewhat inelegant alternative is to group one or several views into a superview, and set the size of the superview to 0 by 0. The subviews will be clipped while drawing.

--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)


  • Follow-Ups:
    • Re: Hiding a view
      • From: email@hidden
  • Prev by Date: keyDown how to pass on events?
  • Next by Date: Re: Hiding a view
  • Previous by thread: Images in a Table
  • Next by thread: Re: Hiding a view
  • Index(es):
    • Date
    • Thread