Re: NSScrollView refuses to scroll
Re: NSScrollView refuses to scroll
- Subject: Re: NSScrollView refuses to scroll
- From: j o a r <email@hidden>
- Date: Wed, 7 Jan 2009 13:26:29 -0800
On Jan 7, 2009, at 1:13 PM, Jason Cox wrote:
If you, in IB, create a new window, throw a NSScrollView in there,
set its autosizing to keep 100% width / height when you resize the
superview, then put an NSTextView at the bottom edge of the
scrollview, compile and resize the window up to hide the NSTextView
it wont put a scrollbar (even though you cant see the textview)
Am i just completely missing the concept of what NSScrollView
does?????
// The basics
The scroll view will only show the scrollers when the frame of its
document view is larger than the frame of its content view (the clip
view).
// A guess
I would guess that when you added the text view, you didn't add it as
the document view of the scroll view, but rather as a subview of the
document view of the scroll view? The scroll view doesn't track or
care about the subviews of its document view, it only cares about the
size of the document view.
// A suggestion
The correct thing to do is typically not to start with a scroll view.
If you simply drag out a text view from the library it comes wrapped
in a scroll view already - No need to add a scroll view manually.
If you need to set it up manually (unlikely), make sure that you
understand the arrangement of views inside the scroll view first.
There is a very good "scroll view programming guide" in the
documentation that can help you get up to speed.
j o a r
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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