4

I'm using a NSCollectionView with OS X 10.11's Flow layout to display a varying amount of content.

If there are too many items displayed, the default is to show scroll bars according to the Scroll Direction property.

In my case, I would like to resize the height of the NSCollectionView dynamically, so that it grows larger and larger with more items being inserted.

If I simply drag the collection view out of the "Bordered Scroll View" and "Clip View", no contents are displayed at all. It's also not possible to set an AutoLayout constraint to link the height of the Bordered Scroll View to the height of the NSCollectionView. So, there has to be a different solution for this.

Etan
  • 17,014
  • 17
  • 89
  • 148
  • How about setting autolayout to boundary constraints to `Bordered Scroll View`, then `collctionView` always follow the frame of `Bordered Scroll View`. After that, change the frame size of `Bordered Scroll View` accordingly? – Harry Ng Jan 15 '16 at 04:36
  • If you drag `NSCollectionView` outside the `NSScrollView`, a copy is being made of the view in the designer. Delete the original scroll view with the collection view and restore the outlets to the 'new' collection view. When done, it should work OK. – Ely Nov 15 '18 at 09:41

0 Answers0