Re: Splitview + Scrollview pinning
Re: Splitview + Scrollview pinning
- Subject: Re: Splitview + Scrollview pinning
- From: Troy Stephens <email@hidden>
- Date: Fri, 18 Jan 2008 16:24:43 -0800
On Jan 18, 2008, at 3:58 PM, Ben Lachman wrote:
I have a splitview that encloses two custom views. One is a pretty
straight forward, just drawing some text inside a frame with some
some effects. The other, which does more custom drawing is enclosed
in a scroller-less scrollview. This is all created programatically,
including the window they're in. Everything works well until I drag
the divider of the splitview. When I do this the top view resizes
properly, but the bottom view is clipped at the top instead of
staying pinned where it is like other views. When I look at the
frame/bounds rects for the views it seems the clipview's origin is
staying constant and it's size is changing. The splitview and
scrollview are flipped but the clipview and custom view is not.
Anyone know a workaround for this kind of issue?
Thanks,
->Ben
The pinning is determined by the document view's flippedness. Since
your custom document view isn't flipped, the bottom-left corner of its
visible rect will remain pinned while its top edge is covered/revealed
as the splitter is dragged.
To get top-left pinning instead, you can either change your document
view to be flipped (requiring changes to its internal layout/drawing
logic, and obviously affecting all instances of that view), or make it
the subview of an identically-sized instance of a flipped NSView
subclass, and make that flipped wrapper view the ScrollView's document
view.
That should do it (unless I misunderstood something in your statement
of the problem?).
--
Troy Stephens
Cocoa Frameworks
Apple, Inc.
_______________________________________________
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