Why does my NSBox draw a background? (boxType = .primary) - cocoa

I realized that suddenly (without me touching the corresponding code) my NSBox has a double visualization. It is as if the Box has a background color and draws its normal rounded frame inside. I added a small screenshot. The parent control is white, the NSBox is gray with the title "Inputs" (unchanged titlePosition). Under the title is the normal box, adding a 2nd shade of gray.
I did not change any of the usual suspects, especially not boxType which is still set to .primary.
I did work on the Dark Mode (Dark Aqua) but cannot see any change that would cause this behaviour. effectiveAppearance is still Aqua.

A NSBox with a boxType of .primary always draws a background. That is intended behaviour. Only if the view behind NSBox is white you may not see it. If you want a NSBox without background you must make it boxType .custom and set the background color as required.

Related

Is it even possible to make NSPopver fully transparent?

I tried my hands on changing the color of NSPopover, I am able to change to it all desired color except transparent.
As, it is known that NSPopover is by default semi transparent. I tried changing the NSWindow color directly, by Layer as well, I also tried setting the NSView's color to transparent i.e. NSColor.Clear but no luck.
So the question is - Is this possible to change the background color of NSPopover to transparent?
No this is (sadly) not possible.

tvOS - UITextField shows white on white when focused

I've created a UITextField on a screen using a custom font (Skia 100 point) and sitting on top of a UIImageView, but otherwise it is quite unremarkable. When it's not focused, the text shows normally, if a bit faint:
When it is focused, however, the entire area renders as a solid white rectangle:
I'd be willing to compromise on the look and feel of this screen if I could get it to render normally when focused, but nothing I've tried has changed it--I always get white-on-white. I read about a similar issue where they said this was due to custom background colors but I have not set a background color. In fact, even if I set a custom text color, it does not seem to take effect--it looks the same.

Access Default Window Color Cocoa

I have an SKView with a picture of a keyboard in a window as shown below. I would like the background color of the SKScene it's presenting to be the same color as the window behind it, so that it would appear as if the keyboard was just in the window, and not in something else that was in the window. After consulting the NSColor documentation, I tried setting the background color of the SKScene as NSColor.windowBackgroundColor(). The color below is what I got. I'm assuming there was some kind of error and so it defaulted to black. That being said, how do I access the default color of a window?
Set the SKView's allowsTransparency to true and then set the SKScene's backgroundColor to NSColor.clearColor().
I think that using windowBackgroundColor() gives black if the view doesn't allow transparency and works if it does because it's effectively being translated to clearColor() by "accident". windowBackgroundColor() is a bit strange. It's not in either an RGB nor a gray-scale color space and it can't be converted to either of those. I'm guessing that SKScene tries to convert the background color to the RGB color space and, when that fails, it uses clearColor() as a fallback.

iOS 7 BarTintColor

Have any one else noticed in iOS7, the translucent navigation bar only shows color underneath if barTintColor is set to default?
I tried setting barTintColor to various different colors, but anything that is below the navigation bar is displayed a a black blur. Whereas if the barTintColor is set to default, all the elements display correctly underneath.
Is there a way to force it to show the correct colors?
You have to use background color instead of tint color.
self.navigationController.navigationBar.backgroundColor = [UIColor yellowColor];
If you are using tint color it changes only barbutton background color change.
In MyTabBarController in the storyboard select the color tint. You will change the button active color background. No idea for the inactive one.

How can I darken everything displayed in a single NSView?

Background: My application has a main window which contains a few smaller NSView objects, each of which contains several different controls, labels, images, etc. One of these views (and everything it contains) is disabled in response to a given flag. When the flag is set, I automatically disable and grey-out all of the controls embedded within that NSView.
Question: I would like to know how to darken the disabled NSView. The effect I am looking for would be something like drawing a 50% transparent black box on top of the disabled NSView. The background and all of the controls would still be visible, but the colors would be a darker shade. Is there a simple way to do this?
CoreAnimation in 10.5 should provide an easy way to put a translucent layer above a view. You can create a black layer in front of the view, with the opacity at 0%. When you want to darken the view, set the opacity of the black layer to 50%, and the view will be darkened smoothly.

Resources