Re: Sizing NSCollectionViewItems to fit

Steve Mills

On Jun 27, 2017, at 03:07 PM, Steve Mills <sjmills@...> wrote:

I'm doing the development of a small app on 10.10, so all the 10.11 additions to NSCollectionView aren't available. I have a window filled with an NSCollectionView in a scrollview, which contains 1 row and scrolls horizontally, and I'd like to resize the NSCollectionViewItems (which are subclassed) to proportionally fit the height of the collection view at the time of being inserted and when the window resizes.

I tried changing the bounds of the itemPrototype in a notification for the collection view's frame being changed, but that's probably not all that needs to happen. Any ideas?

Got it working simply by changing the collectionView.maxItemSize to the size I want in the NSViewFrameDidChangeNotification callback. Whodathunk.

Sent from iCloud's ridiculous UI, so, sorry about the formatting


Join { to automatically receive all group messages.