Black StatusBar with black font in the Windows 10 mobile application

I have a Windows 10 UWP application running on mobile devices. When I run the application in the emulator, everything works fine. When I run it on the device (Lumia 550), the StatusBar is black with a black font, and the status indicators are not visible.

enter image description here

It's some kind of mistake?

I know that I can make the StatusBar have a white background and black, but for the application you need to stick to the theme (black StatusBar in the dark theme, white in the Light theme).

If I create a new empty application under Windows 10 and run it on the device, the problem will be the same that it does not apply to my application.

+4
source share
5

Edit
:

Windows 10 Mobile . RequestedTheme.

, , RequestedTheme Light ( ), .


?: https://stenobot.wordpress.com/2015/07/08/uwp-app-development-styling-the-mobile-status-bar/

.

+1

.

, (Application.RequestedTheme) , . Dark , Light. .

. , ( ) ( ):

<Page
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
    ... >

</Page>

.

0

Light, OnLaunched App.xaml.cs:

rootFrame.Background = new SolidColorBrush(Colors.White);
0

RequestedTheme="Dark" App.xaml

-1

In your help manager, add Windows Mobile extensions for UWP

enter image description here

Then in App.XAML.cson

protected override void OnLaunched(LaunchActivatedEventArgs e)

add

if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
var statusBar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
statusBar.BackgroundColor = Windows.UI.Colors.Green;
statusBar.BackgroundOpacity = 1;
statusBar.ForegroundColor = Colors.White;
}

If you want to change the title bar on the PC version of the UWP application, you can use this

if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView"))
{
    var titleBar = ApplicationView.GetForCurrentView().TitleBar;
    if (titleBar != null)
    {
        titleBar.ButtonBackgroundColor = Colors.DarkBlue;
        titleBar.ButtonForegroundColor = Colors.White;
        titleBar.BackgroundColor = Colors.Blue;
        titleBar.ForegroundColor = Colors.White;
    }
 }
-1
source

Source: https://habr.com/ru/post/1620072/


All Articles