I have an NSImageView in NSView configured in IB. NSImageView is the same size as NSView.
Everything works fine, and NSImageView is the same size as NSView when resizing a window.
BUT, now I have added the animation (transition from A to B) to NSImageView, and this will ruin the restrictions that were set in IB. Therefore, I have to do this programmatically.
How could I programmatically set NSLayoutConstraint so that my NSImageView is the same size as my NSImageView (supervisor)?
UPDATE:
Just to give you guys more information. My application uses a shared view (three views), and instead of adding NSImageView to IB, I now add it programmatically. I am adding a new view (which should be scalable with its parent view) to the third view in split mode.
Do you think shared view is causing these problems?
UPDATE 2:
OK, I'm closer to that. I removed NSImageView from the view and added NSView instead. NSView scaled fine, but as soon as I added NSImageView, it stopped working so that NSImageView didn't scale after resizing the window.
In other words, the problem is NSImageView itself. It will not scale after resizing the window ...
solvable
I solved this using the PDF View instead of the image (it was the PDF I wanted to show). I set the autoScales property to YES in the PDF view.
source share