• 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
Customising cells in IKImageBrowserView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Customising cells in IKImageBrowserView


  • Subject: Customising cells in IKImageBrowserView
  • From: Graham Cox <email@hidden>
  • Date: Tue, 04 Sep 2012 10:40:45 +1000

I want to customise the appearance of a selected cell in an IKImageBrowserView.

I'm subclassing IKIMageBrowserView, and overriding:


- (IKImageBrowserCell*)		newCellForRepresentedItem:(id) anItem
{
	IKImageBrowserCell* cell = [super newCellForRepresentedItem:anItem];

	// set up the selection highlight colour by changing the layer characteristics

	CALayer* selLayer = [cell layerForType:IKImageBrowserCellForegroundLayer];

	selLayer.borderWidth = 1.0;
	selLayer.backgroundColor = [[NSColor greenColor] CGColor];


	return cell;
}


(the appearance isn't what I want, but this is just to see if it works).

The layer returned by -layerForType: is nil, and it is nil for all of the possible layer types. I also tried setting this when the selection changes in the delegate callback, but these layers are always nil. The cell is valid.

Has anyone managed to get this to work?


--Graham


_______________________________________________

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

  • Prev by Date: Re: How to get multiple NSURLs from Finder drop.
  • Next by Date: Re: Create custom NSTableView with a button inside
  • Previous by thread: Re: More sandblasting (oops, I mean sandboxing die die die)
  • Next by thread: Local Properties
  • Index(es):
    • Date
    • Thread