• 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
Changing NSImageView's default background fill color
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing NSImageView's default background fill color


  • Subject: Changing NSImageView's default background fill color
  • From: Carl Hoefs <email@hidden>
  • Date: Mon, 22 Jun 2015 16:25:36 -0700

I have a (subclassed) NSImageView in an NSWindow, and when it displays an image that doesn’t fit proportionally it will show a mid-gray background fill color around the image, apparently by default.

Is there any way I can change that background fill color? To either 0 alpha or black?

The following line does nothing:

    _singleImageView.layer.backgroundColor = [[NSColor blackColor] CGColor];

…even though the layer object is <_NSViewBackingLayer: 0x600000045ac0>.

Cocoa, OS X 10.10.3, Xcode 6.3.2
-Carl

_______________________________________________

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


  • Follow-Ups:
    • Re: Changing NSImageView's default background fill color
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Changing the color of an NSWindow’s titlebar text
  • Next by Date: Re: Changing the color of an NSWindow’s titlebar text
  • Previous by thread: Re: Changing the color of an NSWindow’s titlebar text
  • Next by thread: Re: Changing NSImageView's default background fill color
  • Index(es):
    • Date
    • Thread