Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scrollview sizing/positioning questions



[Xcode 1.2, Mac OS X 10.3.4]

The amount of information that I'm trying to display in a window finally grew to where I needed to put it all in a scrollview. No problem, I thought. In Interface Builder, I selected all of the text fields and boxes, then selected Layout->Make subviews of->Scroll View. This creates a scrollview that is *just* big enough to enclose all of the objects within. It's a little tight, so I grab the edges of the scrollview and make it bigger. Then I tried to move the enclosed objects around. Grabbed a text field, dragged it to the right, it starts to disappear.

Ok, so putting things into a scrollview actually puts them into an NSView inside an NSScrollView, and resizing the scrollview doesn't resize the view inside. But I found that I cannot reliably grab the edges of the view and resize it like I did with the scrollview. In some cases the edges disappear, but this is not entirely predictable.

What I discovered was that I had to set the auto-sizing bars to springs on the inside of the scrollview AND on the inside of the view. This allowed me to grow the view to the size that I need, move the objects inside around, and add additional items to it. To get the scrollview to scroll, I then had to change the springs of the view back to bars, so that the view didn't resize itself when the enclosing scrollview's size changed. This SORT OF makes sense.

After all that, the questions:

1. For getting a bunch of text fields and other items into a scrollview, is this the "right" process, or did I construct a complex solution to a problem with a simpler answer?

2. The scrollview works, but it starts at the bottom left of the view. How can I make it start at the top right? And why would it default to the bottom left anyway?

--
Don Rainwater
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.