• 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: Centering a view in an NSScrollView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Centering a view in an NSScrollView


  • Subject: Re: Centering a view in an NSScrollView
  • From: email@hidden (Henri Hansen)
  • Date: Sun, 27 Jan 2002 12:12:26 +0100

Dustin Mierau writes:

> I have a view in an NSScrollView, when the contentSize of the
> scrollview is larger than my view I want my view to appear
> centered within the scrollview, even as the scrollview is being
> resized. Right now it is tagged to the bottom left. I know I can
> return YES from the isFlipped method to tag it to the top left,
> but like I said, I want it centered. There does not seem to be a
> good way to do this, any ideas?

Well I'm stuck at the same problem.

I too have a window, with a NSScrollView and a NSView. The view is
smaler than the scrollView and so I want to reposition the view
centered in the scrollView. Alltough I can set the new frame for the
view and acording to the debugger the coordinates are corrct, it will
be redrawn in the position indicated by its frame.

On the other hand I have no problem to reposition and change the size
of a view, which is not connected to a scrollView, but which is
directly drawn into the window. So now i wonder if there are some
basic differences concerning a View which is connected to a
scrollView and one, which is drawn directly into a window.

greetings henri


--


  • Prev by Date: Re: NSHTTPURLHandle bugs
  • Next by Date: Re: How ATTRACTIVE is CoCoa development?
  • Previous by thread: Re: Centering a view in an NSScrollView
  • Next by thread: NewbieQ: Why can't I have a customview as an initalResponder??
  • Index(es):
    • Date
    • Thread