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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to