Re: Help visualizing something in IB
Re: Help visualizing something in IB
- Subject: Re: Help visualizing something in IB
- From: Quincey Morris <email@hidden>
- Date: Wed, 10 Mar 2010 15:36:51 -0800
On Mar 10, 2010, at 14:58, Brian Postow wrote:
> Let say I have three views inside a scrollview with some other content. Top, buttons and image. buttons and image are both inside top. Top does NOT fill up the scrollview, however, buttons and image DO fill up top. Top has a maximum size determined at runtime, but it might not all be visible. The buttons view is above the image view. The buttons view should have a fixed height, but stretch width wise. The image view should fill up the topview and stretch in both directions.
>
> The question is what happens when the window with the scrollview resizes, and when the scrollview scrolls.
>
> I want whenever any part of the topview is visible, for the buttonview to be at the top of the visible portion of topView, and I want the imageview to take up whatever space (if any) is available below it. Even if I'm scrolling, or resizing the outer window.
In the terms you have used, this makes no sense to me. You're saying (in effect) that you don't want topView to scroll, but you put it inside a scroll view, so it's going to scroll.
It sounds a little bit like you want to move topView outside the scroll view, and use the window resizing delegate method to apportion space to topView and the scroll view according to some rules you devise. Or, use topView and the scroll view as the two panes of a split view, and write split view delegate code to handle the resizing.
> I currently have in IB:
> TopVew doesn't resize at all, locked top and left.
> ButtonView resizes width but not height and is locked top left
> ImageView resizes both,and is locked top bottom left. (probably adding right wouldn't matter)
If topView doesn't resize at all, its subviews won't auto-resize, regardless of the options you set. Auto-resizing is dependent on the parent view, not on the window. But based on what you say below, topView clearly *is* resizing.
Also, keep in mind that auto-resizing flows downwards (parent views resize their subviews), but not upwards (changes to subviews never automatically resize their parents).
> What's happening is that when I scroll, the whole thing just scrolls, so buttonview goes off the top, and when I make the window too small, the imageview covers the buttonview. It then doesn't UNCOVER it when I make the window bigger or scroll or anything.
It's a known limitation of autoresizing that when the geometry collapses (by resizing the parent too small), you can't recover the original geometry even when you go back to the original size. It's sort of the layout analog to a divide-by-zero error in numerical computations.
_______________________________________________
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