I have a Cocoa application. In the window's view I have placed an NSImageView. Using auto layout I have added leading and trailing spaces in such a way that the NSImageView is anchored to the view (and thus window).
The NSImageView's scaling property have been set to ScaleDown.
When I make the window larger, everything happens as expected. The image is centered in the window and does not scale up.
The problem is when I make the window smaller. Everything works until I hit the image's size. Then I can't make the window any smaller.
In other words I can only make the window as small as the image's size. What I want - and did expect by using the ScaleDown setting - is to have the image scale down with the window.
The image view's compression resistance priority is higher than NSLayoutPriorityWindowSizeStayPut
(500). So, the image view's resistance to being compressed prevents the window from resizing.
Lower that resistance priority.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With