Re: IB 2.2 Autoresizing problems
Re: IB 2.2 Autoresizing problems
- Subject: Re: IB 2.2 Autoresizing problems
- From: Henri Lamiraux <email@hidden>
- Date: Wed, 19 Jun 2002 06:41:52 -0700
The Lock View Frame in IB has no impact on the Runtime (Cocoa
Framework). All IB design settings are saved in a separate file inside
the nib folder and are never loaded at runtime. The Developer tools
doesn't change the runtime (e.g. they don't install a new version of
the cocoa framework). I am pretty sure also that changing a view origin
has ever tricker auto view resizing. Auto resizing is only tricker by a
super view changing size. Auto resizing masks don't apply between
siblings.
On Monday, June 10, 2002, at 06:04 PM, Angela Brett wrote:
Hi,
My app has a custom view in its own nib which has a number of
subviews, for selecting a search criterion. The app loads as many
copies of these view from the nib as the user wants, and they're all
put into an NSScrollView one underneath the other. This worked fine
when I first coded it (quite some time ago) but ever since I got the
December 2001 dev tools it hasn't been working quite correctly. Here
are the relevant parts of the code:
- (IBAction)moreOptions:(id)sender {
if (![NSBundle loadNibNamed:@"searchView" owner:self]) return;
//some code for storing this copy of the nib's subviews in an
NSDictionary
//omitted since it's not relevant
[self resizeScrollView]; //this method just ensures the scrollView
is the right size to hold all the searchViews and shows the scrollbars
if necessary
//omitted code to get the main custom view into the newView variable
//I think I've mucked around with the order of the next few lines
with no luck...
[[scrollView documentView] setFrameSize:NSMakeSize(250
80*numberOfVisibleSearchViews)];
[[scrollView documentView] addSubview:newView];
[newView setFrameOrigin:NSMakePoint(0,0)]; //this puts the new view
below the others, which before I got the December dev tools would move
up because the view's autoresizingmask is NSViewMinYMargin, but now
they all stay at the bottom so I end up with all the copies of the
view on top of each other
//omitted code for adding buttons to add/remove search views if
necessary
[[scrollView superview] display];
}
I've tried changing the view's autoresizing mask to other settings
both in the code and in IB, and I've tried changing the order of the
resizing of the scrollView's documentView and adding the new view, and
I've tried changing the 'Lock View Frame' option of the search view in
IB, but nothing works. I could get the views to be spaced out properly
if I manually changed the location of the other visible views each
time I add one, or by adding each new view at the top instead of the
bottom (which doesn't really make sense) but I would rather know why
the code which worked before I got the December dev tools now doesn't.
Perhaps it has something to do with the Lock View Frame option that's
now in IB.
Any ideas?
--
Angela Brett
email: email@hidden
Cocoa development: http://cocoa.co.nz
homepage: http://acronyms.co.nz/angela
_______________________________________________
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.
Henri Lamiraux
Engineering Manager
User Interface Tools Group
Apple
_______________________________________________
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.