views:

129

answers:

1

I have a vertical NSSplitView containing on one of its sides a NSScrollView with a IKImageBrowserView inside. The IKImageBrowserView shows only one row of thumbnails and only has horizontal scroller (the resizing mask is equal to NSViewWidthSizable).

I would like to bind the zoom level of the IKImageBrowserView to the height of any of the container's frame, so that when I move the divider, the thumbnails change size to always fit vertically in the view. I would also like this to happen continuously while moving the divider, not only after releasing it. Is this at all possible?

A: 

To answer my own question, if instead of setting the zoom factor for the IKImageBrowserView in Interface Builder, you set it to 1.0f in code, it will adjust the images to the size of the container. Just doing the following in my NSViewController loadView method solved the issue:

- (void) loadView {
    [super loadView];
    [browserView setZoomValue:1.0f];
}
Miguel Ángel Friginal