cocoaosx-snow-leopardikimagebrowserview

how to set background color to IKImageBrowserView


I am new to cocoa.. I am creating one of the colorful window. so I need set background color to IKImageBrowserView. I think subclassing IKImageBrowserView is the way to set background color but it is too difficult for me.. Any other way to set background color without subclassing?


Solution

  • You can achieve what You want by using setValue:forKey with option key IKImageBrowserBackgroundColorKey like this:

    [imageBrowserViewOutlet setValue:[NSColor redColor] forKey:IKImageBrowserBackgroundColorKey];
    

    Note: imageBrowserViewOutlet is IKImageBrowserView outlet.