• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Resizing view of NSCollectionViewItem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Resizing view of NSCollectionViewItem
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Make a solid line look like 3D
  • Next by Date: Re: Make a solid line look like 3D
  • Previous by thread: Re: Is there a cocoa treeview?
  • Next by thread: Re: Resizing view of NSCollectionViewItem
  • Index(es):
    • Date
    • Thread