Re: How to make single-row IKImageBrowserView?
Re: How to make single-row IKImageBrowserView?
- Subject: Re: How to make single-row IKImageBrowserView?
- From: Ashley Clark <email@hidden>
- Date: Tue, 17 Nov 2009 18:22:58 -0600
On Nov 10, 2009, at 4:55 PM, John Fox wrote:
> Hello Nice Cocoa People:
>
> I'd like to be able to create an IKImageBrowserView that only displays a single row of items that scrolls horizontally as needed. I didn't find any public API for doing this, even though (from what I understand at least) IKImageBrowserView uses NSCollectionView which has the setMaxiumumNumberOfRows: method. Is there some public way of accessing an IKImageBrowserViews's underlying NSCollectionView instance? Otherwise, is there some trick I'm missing? Someone suggested that I could programmatically set the size of by image browser view based on the cell size and the number of items, which I imagine would work, but I'm wondering if there's an easier way.
>
> Any help greatly appreciated.
Set the height of your browser view to whatever you'd like that will contain a single row of your image cells. Then in your controller's -awakeFromNib use [imageBrowser setContentResizingMask:NSViewWidthSizable] to tell it you only want it to expand horizontally. Apparently the default is NSViewHeightSizable and I see no way to override that via IB.
The normal autosizing springs/struts in IB don't seem to affect the contentResizingMask at all for an IKImageBrowserView.
Ashley
_______________________________________________
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