Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 656081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:40:31+00:00 2026-05-13T22:40:31+00:00

I have an NSCollectionView that contains a collection of CustomViews . Initially it tiled

  • 0

I have an NSCollectionView that contains a collection of CustomViews. Initially it tiled the subviews into columns and rows like a grid. I then set the Columns property in IB to 1, so now it just displays them one after another in rows. However, even though my CustomView is 400px wide, it’s set to autoresize, the NSCollectionView is 400px wide, and it’s set to 1 column, the subviews are drawn about 80px wide.

I know I can get around this by calling:

CGFloat width = collectionView.bounds.size.width;
NSSize size = NSMakeSize(width, 85);
[collectionView setMinItemSize:size];
[collectionView setMaxItemSize:size];

But putting this code in the awakeFromNib method of my WindowController only sets the correct width when the program launches. When I resize the window (and the NSCollectionView autoresizes as I’ve specified), the CustomViews stay at their initially set width.

I’m happy to take care of resizing the subviews myself if need be, but I’m quite new to Cocoa and can’t seem to find any articles explaining how to do such a thing. Can someone point me in the right direction?

Anthony

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:40:31+00:00Added an answer on May 13, 2026 at 10:40 pm

    Matt Gallagher’s wonderful blog Cocoa with Love is about to address this. This week, he shared the bindings details of a one-column view like the one in question:

    http://cocoawithlove.com/2010/03/designing-view-with-bindings.html

    Next entry, he promises to share the rest of the implementation, which should give you what you’re looking for.

    (I should note that he is subclassing NSView directly and re-implementing many of NSCollectionView’s features. This seems to be common though; not many people are fond of subclassing NSCollectionView.)

    Edit: Seems he broke his promise… we never did receive that post. See tofutim’s answer below instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list view class that just like NSCollectionView requires an additional prototype
I have a basic Cocoa app with a custom NSCollectionView that overrides drawRect: to
I have a button that is inside a view repeated inside a NSCollectionView. I
I have an NSCollectionView that lists items from a Core Data source. Each item
I have a NSCollectionView , that displays some files: What I want is... being
So I have an NSCollectionView that has a list of songs. When I update
I have a NSCollectionView is bound to an NSArrayController that has an NSMutableArray as
I have a song playing app. The songs are loaded into a NSCollectionView. There
I'd like to have a view that looks more or less like the message
I have a NSCollectionView that I populate using [collectionView setContent:data]; where data is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.