I need help in changing the text color of Xamarin app in the status Bar because when Changing the status bar color to white the text color stays white, thus not appearing.
enter image description here
Use the following code in style.xml when you change status bar color .
<item name="android:windowLightStatusBar">true</item>
This makes the text will always appear whatever the background color is .
Refer to
Change status bar text color when primaryDark is white.
Related
Looking to change the status bar text colour (on a per view basis) using swiftui but cannot seem to do it?
I can change it for the whole app but some screens have a different status bar colour so the text needs to switch from black to white when the background is dark?
Any ideas on how to achieve this?
I am making a dark theme for my app, where all the background is black and text and controls are orange. I also want the status bar to correspond to this theme, but .lightContent option, which is designed for dark backgrounds, returns white text color. I was wondering if it's at all possible to make status bar text something other than black or white (orange, in my case)?
It is not possible to change the status bar's text color as the apple provided only two colors for displaying status bar text which is white and black.
To display white text add the following stuff to your project Info.plist
View controller-based status bar appearance = false
Status bar style = Transparent black style (alpha of 0.5)
To display black text add the following stuff to your project Info.plist
View controller-based status bar appearance = false
Status bar style = Gray style (default) OR Opaque black style
I know how to change text color to black or white, but is there some way to change text to green and BG to red for example?
The text of the status bar may only be black or white. You can read more in Apple's iOS Human Interface Guidelines.
The background color is based on what is behind the status bar. You could, for example, add a 20-pixel tall view with a solid color at the top of your view to color it. Here is a description of how to do that programmatically in Objective-C. You can use the same idea using Storyboard.
My project's plist file has a flag View controller-based status bar appearance = NO (this is required by my app specifics).
And I tried to set Status bar style to Gray style (default) and Opaque black style.
But in both cases I get a white status bar text and so it's invisible on a white splash screen.
Is there any way to force the status bar text to black color on splash screen?
I've searched through the other questions like this, but found only setting the status bar text color to white:
Changing the status bar text color in splash screen iOS 7.
And the solution proposed there doesn't seem to work for setting the color to black, at least for iOS 8.
Any help is appreciated.
In the General Project Settings screen, there is a "Hide Status Bar" option. Please be sure that it is unchecked.
After that, open the LaunchScreen.xib file and select the view, in the Simulated Metrics section, if you select Default, it should show black status bar.
Result:
I want the Status Bar of my app to have the exact same color as my Navigation Bar. The way I found to change the color of the Status Bar was just by creating a view in the size of the Status Bar and change the background color.
However even though I use the color picker from the Nav bar to set the color of the view I get 2 totally different colors as seen in the picture below.
I've tried mixing with the color picker, changing opacity etc, however I'm never able to hit the correct color. Any ideas on how I can get the exact same color for the status bar?
The color of the UIStatusBar is automatically set to match the color of the UINavigationBar when you set the value of self.navigationController.navigationBar.barTintColor. Is there a reason you need to set them separately?
You can do the following:
Create an UIImage containing only the color you want with a size of 64x1. You could render that image in code.
Set the image as a background image for the navigationBar. Something like:
navigationController.navigationBar.setBackgroundImage(image, for: .default)