Resizing view of NSCollectionViewItem
Resizing view of NSCollectionViewItem
- Subject: Resizing view of NSCollectionViewItem
- From: PCWiz <email@hidden>
- Date: Sun, 25 Oct 2009 17:42:34 -0600
I need to programatically resize the view of an NSCollectionViewItem
as soon as it is created. So far I tried this (subclassing
NSCollectionView and overriding newItemForRepresentedObject)
@implementation IGCollectionView
- (NSCollectionViewItem *)newItemForRepresentedObject:(id)object {
NSCollectionViewItem *newItem = [[self itemPrototype] copy];
[newItem setRepresentedObject:object];
NSView *itemView = [newItem view];
[itemView setFrame:NSMakeRect([itemView frame].origin.x,
[itemView frame].origin.y, [itemView frame].size.width, 500)];
return newItem;
}
@end
Nothing happens. I also put this in the awakeFromNib method of my main
app controller:
[collectionView setMaxItemSize:NSMakeSize(999, 999)];
To make sure that it wasnt being restricted by the max size. Is there
a better way to do this?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden