Re: Sizing NSCollectionViewItems to fit


Jon Gotow
 

On Jun 27, 2017, at 2:07 PM, Steve Mills <sjmills@mac.com> 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?
Did you call -reloadData after resizing the itemPrototype? You have to get the collection view to regenerate all the views with the newly resized prototype.

- Jon

Join cocoa@apple-dev.groups.io to automatically receive all group messages.