How can I resize my NSCollectionView to fit the size of all my items ?
I tried something like that :
float height=0;
for(int i=0;i<[drives count]; i++) {
height += [[[collectionView itemAtIndex:i] view] bounds].size.height;
}
NSLog(@"%lg", height);
[[self view] setBoundsSize:NSMakeSize(300, height)];
and all I got was a horrible result : the collectionView was distorted. It was previously smaller than the parent view and with that it expanded to fill the parent view.
NB : I removed the scrollbars of the collection view and inner items are NSBox.
Ps : this what I have without any resizing ;