Set specific background color in iOS LaunchScreen.storyboard (Visual Studio for Mac) - ios

Ok, I can't believe I'm asking this but... how do you set a specific color as the background of a UIView. I mean:
I select the UIView.
I set #2374A5 as the background color (using the color picker).
Visual Studio sets #1D5F93 as the background color (what??).
EDIT: Ok, just after I posted the question I remembered that I could actually edit the Storyboard in XCode Interface Builder and, there, it worked as expected. However, I'm still puzzled as to why VS changes the color I choose. Is it a bug, or is there any obtuse logic behind it that I'm not seeing?

Related

How to change android app icon background color in xamarin

Variations of this question have been asked over the years but I have not found anything current, up-to-date, and step-by-step. The closest thing I have found is this but it is hard to follow and not completely accurate.
https://learn.microsoft.com/en-us/answers/questions/696540/background-color-for-launcher-icons.html
For instance, it refers to Visual Studio 2017 documentation on how to change the app icon that just does not work even in the Visual Studio 2022. Really, after so many years we have no easy way of setting the app icon?
https://learn.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows#specify-the-application-icon
I my case I was really just trying to change the background color, which was showing up correctly under iOS but under Android was just white. So what is the best way of accomplishing this?
So the current site for creating all your iOS and Android icons is here:
https://icon.kitchen/
You upload your image with a transparent background and then select your background color. It gives you a preview of what your icon will look like and you tap Download to get a zip file containing all the icons you need with the proper folder structure.
In the case of Android you copy the mipmap* folders into your res or Resource folder in the Droid project folder.
There is one adjustment that you will have to make to the two files in the mipmap-anydpi-v26 folder. They come named "ic_launcher" but for some buggy reason they need to be named "icon".
After changing their name we encounter the next critical step due to the bug in the "Droid project Properties/Android Manifest/Application icon". You should be able to set your icon here but it does not work! Instead you must modify AndroidManifest.xml by hand to add the android:icon as follows:
<application android:label="γDog" android:theme="#style/MyTheme" android:icon="#mipmap/icon">
If you ever change the properties again you will need to make this change again because it will revert back and cause an error in your compilation.
One caveat is that on some Android platforms the background color is evidently not used and is instead left transparent.

Main.storyboard is pitch black

I've been coding in Xcode for a long time but I've never used the storyboard. When I opened it up I got this pitch-black.
Does any one know how to fix this ?
A lot can cause a black screen. I think, most likely, you are currently previewing dark mode. You can switch back to light mode by clicking View as and changing the appearance.
Or, the background color of the view might be set to black (probably not the case though). You can change this in the attributes inspector.
Black color
System background color
System Background Color is white in light mode, and black in dark mode.
And there's always the possibility that Xcode is glitching. In that case, quit and relaunch.
For me, I had a datepicker set to inline mode, and it messed things up. I'd try and recall if you did anything that Xcode didn't like before it went black, and try and reverse that.

Magic behind views automatically adapting to ios13 dark mode?

I found it quite weird that for new projects created by xcode 11 beta, common views like UILabel, UIButton in a storyboard can automatically adapt themselves to system theme changes without any code. But for my old projects still using XIB, even though all colors are set to default, they dont change when system theme changed, i still have to manually override traitCollectionDidChange and assign them system default values in order to make them change! What am i doing wrong? thanks.
I figured out. The magic is the newly added system colors to UIColor on ios 13, for example, UIColor.systemBackgroundColor, it will be white in light mode and black in dark mode, once you assign a system color to a property, it always updates itself based on system theme. So i guess UIViews created in xcode 11 beta storyboards automatically have system colors on.

Syncing custom colors in XCode / Colors in git repo

When you work with colors in Interface Builder, sometimes it's handy to create your custom set of colors for your brand, so that setting color is just a click away. It's possible to add a new color set in Colors -> Color Palettes, and it works pretty well.
The thing is, this custom color set is not part of your project / repo. It works fine locally on your Mac, but your colleagues may have to set it up again on their machines. If you configure UIColor programmatically, you can have a central place (e.g., a Category for UIColor) in your codebase, which for sure will be in git repo. So the question is, is it possible to do the same for the color set here? Is there a way to sync the custom color set? Where is it actually stored?
The color palette is stored in your ~/Library/Colors. Once the palette is stored, it is visible for other applications such Photoshop etc.

How to access the system selected menu item blue color?

I'm working on an app that has a custom NSView on a NSStatusBar which performs all of the drawing when the user clicks it. But here's the problem, the color I'm currently drawing as the view's background color is not the same as the system blue color.
My app's color:
Twitter's menu item color (system):
As you clearly see, my blue color is way lighter than the system. This is the code I'm currently using (and worked perfectly on versions older than Yosemite):
[[NSColor selectedMenuItemColor] set];
NSRectFill(rect);
I've even tried color picking the menu item's color but it seems like the color is affected by the wallpaper below the menu bar.
Any ideas on how to achieve the system look?
As you said, in Yosemite, docks, status bars etc. are affected by whatever is behind them. Try enabling System Preferences > Accessibility > Display > Reduce Transparency and you'll see what your color looks like without this feature./
Here is an idea - Maybe you should use the Vibrancy effect and derive from NSVisualEffectView. I knew that I've seen a very similar thread somewhere here in the past, and it took me quite some time to find it. Here it is:
Trouble matching the vibrant background of a Yosemite NSMenuItem containing a custom view
I think Matthes' answer to that question would lead you to the resolution of your issue. Be sure to check it out. I hope it will help - Good luck and report back!

Resources