I have a Windows 10 UWP app running on mobile. When I run the app in an emulator, everything works fine. When I run it on a device (Lumia 550), the StatusBar is black with black font and the status indicators are not visible.
Is this some kind of bug?
I know I can force the StatusBar to have white background and black color, but the requirement for the app is to stick with the theme (black StatusBar in dark theme, white in Light theme).
If I create a new empty Windows 10 app and run it on a device, the problem is the same, it is not specific to my app.
In your reference Manager add Windows Mobile extensions for the UWP
Then in
App.XAML.cs
onadd
If you want to change Title bar on PC version of UWP app, then you could use this
If you got the black font on the black background with your Light theme project, simple add this line into
OnLaunched
method inApp.xaml.cs
:Just add
RequestedTheme="Dark"
in App.xamlEdit
Here's a more proper answer:
In Windows 10 Mobile the statusbar inherits it's background color from the topmost page. The foreground color is inherited from
RequestedTheme
.This means that if you set the background color of your page to black and your
RequestedTheme
toLight
(which gives a white foreground color), the text will be black on black.Original post
Have you read this?: https://stenobot.wordpress.com/2015/07/08/uwp-app-development-styling-the-mobile-status-bar/
It might help you.
I have struggled with this a bit.
A strange thing is that when I start my app, the theme (
Application.RequestedTheme
) is always Light, ignoring the setting on the phone. Even when I try to set it to Dark in the constructor, it immediately reverts to Light. This could explain the black foreground color.I also experience the inconsistency between simulator and device. To take care of that, I (as suggested in other answer) set the background color of the page (not the root Grid):
With this, the status bar at least appear readable.