Re: Maintaining subview spacing when resizing
Re: Maintaining subview spacing when resizing
- Subject: Re: Maintaining subview spacing when resizing
- From: Brian Webster <email@hidden>
- Date: Wed, 3 Jul 2002 14:33:04 -0500
On Wednesday, July 3, 2002, at 01:04 PM, cocoa-dev-
email@hidden wrote:
I have a window with a 2 by 2 arrangement of scrollable text views and
have found that none of the available sizing options allow the
preservation of subview spacing. I suspect I'll have to make a custom
view class and write my own controller to do what I want, but just
wanted to check here to see if anyone knows a purely IB way to
accomplish this.
In theory there is, but the implementation is somewhat lacking.
Drag four text views into a window. Set all of the inner
springs in both directions to "springy" for all four views.
Then set two outer springs for for each view in the two
directions in which the view is not touching the edge of the
window (e.g. for the upper left view, enable the right and
bottom springs). If you test the interface and resize the
window niiiice and slow, everything works pretty much OK. But
if you continually resize the window larger and smaller,
eventually the views will start to collide and overlap each
other. This is due to a rounding error that creeps in when many
multiple resizes are performed. I don't know if Apple considers
this a bug or if they'll fix in anytime in the future.
So, in short, yes, you will have to either write a custom view
to contain the four views and resize them using
resizeSubviewsWithOldSize:, or write a subclass for the text
view (a little complicated since you actually have to subclass
NSScrollView and put a text view inside it) and implement
resizeWithOldSuperviewSize:.
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.