Interface Builder change text color bug? - xcode

This is driving me bananas..
If I select a UITextField in interface builder and go to change the text colour by manually entering the R G B values it changes the colour of the entire frame and background.
However if I change it using the sliders it changes the text colour only like I want.
Leads me to think its a bug... does this happen for anyone else?

I see this happening with the latest version of Xcode as well. Both the Text Color and Background Color controls in the UILabel attribute inspector change at the same time when manually typing in a R G B value, whereas if I choose a color another way (e.g. from the crayons or palette views in the Color picker), only the text color control value changes.
I'd assume this is a bug (and should be filed via http://bugreporter.apple.com), but then again it's persisted through a few versions of Xcode so this may be their expected behavior on purpose. But I'd definitely agree you should file it as a bug.

Definitely a bug! A temporary solution is to double click the text on the UILabel i.e. selecting all the UILabel text in the UI (storyboard or xib). Only so using the sliders changes the text colour. Hope it helps

Or change the color and then set the background color back to transparent. For me the fastest workaround. Same bug with UILabel.

You can try selecting the text you want to change the color of, then click T to open the fonts window and change the color from there. Working for me on Xcode 11.2.1.

Related

How to custom the focus ring color of NSTextField?

I have a custom NSTextField, named MySearchField. When I put it on the top of NSVisualEffectView and run my app on macOS 11.x, ring focus color of the text field and background color of selected text both turns white.
It seems that there is no API to adjust this in Apple API Reference. But I found the style of search field on Mac App Store is what I want.
So, How should I solve this problem? Any help will be appreciated!
EDIT
Accent color seems to cause this problem. In this case, multicolor is selected. How to specify an accent color for NSTextField?

Clear Color Swatches on Xcode Color Window?

You know how under Storyboard / Interface Builder, you can assign a custom color and save it to the color palette below? How would you clear those and start over with all of them blank? I'm not sure how to delete them rather than overriding them with another color.
As of Xcode 9 / macOS High Sierra, the accepted answer doesn't work any more. The colors in the palette are now selectable/draggable - once a blue border appears around the selected color, press delete key to remove it.
If you don't see a blue border, when clicking on a color, make sure that the "Colors" window is active.
Just drag the saved color to the Trash on the dock!!!
I do not see any method of completely clearing your palette, but the single swatches get replaced with an empty one if you click and drag them over to another slot.
So for a simple solution to virtually start over (with the exception of 1 square) is by simply dragging all your colors over to the same square.
You can then just replace this single square with whatever color you want.
Hope this helps!

Why does the default background of the uivew is black in IB xcode?

When i set the default background for the view (the view is used as a header for the table) in IB it becomes black but when I run the app on a simulator it has the default color of the uitableview background.
When i set the default color to yellow for example it is always yellow for both IB and simulator.
why the default background color is black in IB and gray with stripes in a simulator?
Because the Interface Builder in Xcode has bugs. I assume you mean you are setting the background color to the "default" option?
I have run into several similar bugs with background color, sometimes it even sets the background color of an element that isn't supposed to have a background color. What I usually do is right click on the xib or storyboard file and Open As Source Code. Then find my element and carefully delete the background property (make a backup of the file if you are concerned about accidentally breaking the complex xml file structure). Then open it as Interface Builder again and it usually figures things out.
Or, worst case, I delete the problem element or view and recreate it.
Edit: it also occurred to me that the default color could be the clear color, in which case, the texture is showing through the view, not being drawn as the view's background, and interface builder chooses black because A) it doesn't know what the view will be drawn on top of and/or B) the view or parent view is marked as opaque or something to that effect.

Can't find an option to set a view colour using RGB or hex in XCode 4.2

In XCode 4.2, I want to set a view's background colour to a particular RGB value. However, I don't appear to have the "RGB Sliders" option that I used to have (perhaps in a previous version). I'm looking for something like the dialog shown in this answer to another question, but all I've got is this:
There are no other options in the drop-down that says "Spectrum". Does anyone know if/how I can get XCode to accept RGB or hex values?
I figured it out:
Click on the button on the top right of the title bar to reveal the toolbar.
Click on the sliders icon.
Seems obvious in hindsight, but if you don't know then you don't know.
You can build an RGB color programmatically using the UIColor method colorWithRed:green:blue:alpha:, then just set it to the view's backgroundColor property. I know this isn't the graphical solution you were looking for, but it's somewhat of a workaround.

Background for Mac OS X app and other elements like NSButton, NSTabView

I changed the background color for my app, but other elements keep the same background color.
Looks like I missed some easy configuration, bsc for NSTabViewItems item colors is deprecated by docs, and using current theme...
You can't easily adjust the tint of the standard controls. You're going to have to subclass and override the drawing code for each of the elements.
Also, may I humbly suggest that you leave it the default color?
U may use Core Animation layer in IB. Choose your object (for example button),
open the view effects inspector (⎇⌘8), set checkbox with your object, add "content filters"
color monochrome and set color! That is all!

Resources