iOS 16 text in status bar is white even when UIStatusBarStyle is set to DarkContent - xamarin.ios

Problem
Currently I'm developing an application and on iOS 16 the text color of the statusbar is often white while the background color of the customized header has a light color. In the code of the customized header there's a check that should set the correct UIStatusBarStyle based on the color of the header. When the header has a light color the text in the status bar should be black and the text should be white when the background color of the header is dark.
Since iOS 16 this logic doesn't work properly anymore and I've tried to fix it but it doesn't seem to work.
I don't have this behavior on simulators but I can reproduce it on an iPhone 12 with iOS 16.
The project uses Xamarin.iOS and C#.
What I tried
In the AppDelegate I've set the UIStatusBarStyle to DarkContent when the iOS is 16.
In the customized header I set the UIStatusBarStyle to DarkContent when the iOS is 16 with an if statement and a return. I also set the UIStatusBarStyle to DarkContent when the backgroundcolor of the header has a light color (fall back for other iOS versions).
Does anyone have the same behavior on iOS 16 with the UIStatusBarStyle? I only found one post about it and it's more for the end user and not for developers.

I just had this same issue for iOS 16. Most of my views are dark so, I was wanting a status bar with white characters ( which was working fine using UIStatusBarStyle on iOS 15), regardless of user's Darkmode/LightMode settings. I was able to achieve it by setting .preferredColorScheme(.dark) where needed.
Edit:
Just to clarify this though, .preferredColorScheme(.dark) will set your view to dark mode, so use only if that doesn't matter.
As an alternative, you might have better luck playing around with things such as
.toolbarColorScheme(.dark, for: .navigationBar)
.toolbarBackground(.visible, for: .navigationBar)
in such cases where you are using a navigation bar. If you are not using one, you might be able to achieve your aim by setting .toolbarBackground(.hidden, for: .navigationBar) and playing around with it to whatever end. Hope this helps.

Related

How do I change the color of the navigation bar icons? (Android studio)

To avoid confusion as to what the navigationbaractually is, here's a
As you can see, I've added a new color instead of the standard black color using:
<item name="android:navigationBarColor">#color/colorBackground</item>
But the icons are barely visible now, so I would like to change them into being black, or at least darker. I have searched SO and the webb but came up empty handed. Any ideas?
You cannot change the color of the buttons yourself.
However you can try to set the navigationbarlight to true. It should be noted that this is only available from API level 27.
windowLightNavigationBar
added in API level 27
int windowLightNavigationBar
If set, the navigation bar will be drawn such that it is compatible
with a light navigation bar background.
For this to take effect, the window must be drawing the system bar
backgrounds with windowDrawsSystemBarBackgrounds and the navigation
bar must not have been requested to be translucent with
windowTranslucentNavigation. Corresponds to setting
SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR on the decor view.
May be a boolean value, such as "true" or "false".
source

Background color is not visible for cardview when i tried running in Kitkat

The white portion is actually card layout. I have kept backgrountTint for it. It is working fine in lollipop and above but appears like this in below lollipop. Is there any way to make it supportive
https://i.stack.imgur.com/CHiqx.png
Seems like backgroundTint doesn't work on pre-Lollipop devices. For setting CardView background color use app:cardBackgroundColor.

Tile/live tile change color when windows change theme UWP

In my UWP application in tile I set black color of background, and icon has transperent background, it's look very well. But then i change theme in windows 10(desktop) to white and my tile change background color to white. Why is it happend, when i set color - black in manifest of application. Like in this application.
Best regards, Dmitry
I can't add a comment but if you mean the high contrast setting I do not believe this is possible since the tile settings cannot be changed at runtime and there is no other way to set the color outside of the apps manifest. You can create override the styles for other controls but not for the tiles properties.
"Note It’s possible to override the system color resources for high-contrast color and accent color by creating resources with the same names, but it’s a best practice to respect the user’s color choices, especially for high-contrast settings. Xaml Theme Resources
More on high contrast themes here: High Contrast Themes - MSDN
I would instead try setting the image background to not be transparent and take up the whole space of the tile. You won't be able to change it but it appears you want it always black anyways. I am not certain this will work in your scenario though since you are using a live tile and not just an image.
You may also want to look at using a secondary tile: Theme Resources

Monotouch - Set TintColor of UISearchBar

I'm using a UISearchDisplayController and I'm trying to set the TintColor of the UISearchBar. The problem is that the color does not come though correctly. In interface builder the color of the search bar is correct after setting the tint property, but when the app runs, the search bar will be the same color, just a lot lighter. E.g. If I set the TintColor to black in interface builder it looks right in the designer, but when I run the app the color will come though medium grey.
I have also tried setting it in code like below, with no luck.
SearchDisplayController.SearchBar.TintColor = UIColor.Black;
Any Ideas? I'm a bit lost on this one.
This seems to be a bug in iOS 5/6. Happens to me when I connect the search bar to a search display controller, but not otherwise.
How I (strangely) fixed it:
Add a segmented controller to your view, change it's tint color to your desired color. Now you will get the right color on your search bar as well.
I did not try it in Xcode but, API wise, UISearchBar has both a BackgroundColor and a TintColor and they are not identical. What you describe (grey'ing) is normal when using TintColor while using BackgroundColor should give you a pure color.

Web Colors - Light Grays on PC not showing

I could be completely off but just wanted to see if there was anything on this subject:
I'm developing a site at the moment that includes a few DIVs that use different shades of really light greys for background and border colors. On both my Mac (laptop and desktop) the colors can be seen quite easily. However, on PC (both Firefox and IE) the colors are not there at all.
The current colors I have are #E9E9E9 and #E1E1E1.
The weird thing is when I change the colors to something darker like #CCCCCC the color is easily seen on PCs and I would assume I could put up a few more shades lighter. But when I move it to the next color like #DDDDDD the color is completely gone.
Just on a limb but is there any weird thing like PC's not rendering certain color codes or am I just trying to make something out of nothing here?
I've been in the exact situation and I had a hard time designing UIs because of this issue.
I'm on Ubuntu 18.04 and Chrome, either of which is not the problem.
This issue resides in the monitor settings, in my case I'm using a Samsung Monitor.
I've solved my issue by doing the following:
Reveal your Monitor Settings (via some button in your monitor).
Navigate to Menu, and then go to Picture.
Scroll down to reveal the other settings down below.
Set HDMI Black Level to Normal
Instantaneously you'll see your black colors improved.
There shouldn't be any problem with a PC displaying those colors. It could be a problem with your PC's video settings or your monitor. Have you tried it with multiple PCs and monitors?

Resources