Customising cells in IKImageBrowserView
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