How to set dark background for iOS10 today widget - ios

I'm trying to workout how to set the background of an iOS 10 today extension/widget to what looks like a default dark mode. In the image below you can see the Weather Underground today widget and it is dark. There are a few apps with a dark background and they all look like the same background/style so I'm thinking it maybe a specific dark mode that can be set in code rather than just fiddling with the view controller color/transparency - no matter how much I try to set the color and transparency manually in the story board I can't even get close to this effect.

You can't do this. The apps that look like this, are not updated for iOS 10 yet. You can see that it hasn't been updated, because it is expanded without showing the "Show less"/"Show more" button.

Related

Button background alignment

I'm a long-time web dev trying to get into iOS development and Xcode so please forgive me for the simplest of questions.
I have a strange issue when I cannot centre align button text within a button's background image. Please see the screenshot below. At the moment you can see the text sits right aligned to the background image.
It’s not a background image. Think of it more like an icon.
It looks like you might want to set your Style to “Default”. Then it will show a background field under image

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.

iOS 11+ launch screen - custom named colors in dark mode

Is it possible to use user defined named colors in the launch screen storyboard?
I tried creating test color in xcassets, with appearances {dark, any} and setting it as Launch screen main view background.
I noticed significant differences:
- in RELEASE my custom colors never work
- in DEBUG some colors work, some are ignored, some are changing values (e.x. dark color is correct, but light is biased), and generally it is a mess
I know I need to delete app every time since launch screen is cached, are there any additional constraints? I fail to get any consistent results. Only thing that seems to work is "System background color".
Similar question goes for images.
OK, so short update. It is possible to use named colors and images with dark appearance on the launch screen after all.
It just works like nightmare. Which means that some parts are getting somehow cached (not sure what is happening underneath).
The final result is that to get consistent results, I had not only to delete app from the device, but also restart the phone.
I also noticed, that images with dark appearance are somehow broken - twice bigger or twice smaller, than their "any" appearance counterparts (even when I used exactly same files). That altogether creates unbelievable mess making it hard to test.
This is still a mess in iOS 13. I ended up using the build in dynamic system colours and tinting them with an overlay.

Change launchScreen color

My application supported multi-theme. I need to change the launch screen color after user changing the theme.
Is this possible? I tried to set the color in app delegate in application.didFinishLaunchingWithOptions but nothing changed.
No, a launch screen is static and can't be changed in any way at runtime.
Keep in mind that the launch screen is shown before your app is actually running.

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