Enable status bar in javascript templates for Windows Phone for Visual Studio 2013

Does anyone know how to enable status bar (image) in windows phone 8.1 javascript application? I am using Pivot javascript template in Visual Studio 2013 with Update 2.

enter image description here

+4
source share
2 answers

You need to add JavaScript to the finished page function, for example.

First create a status bar for the current view. How to decide what to do with it:

var s = Windows.UI.ViewManagement.StatusBar.getForCurrentView();
s.showAsync(); // shows the statusbar

More information on the status bar can be found on MSDN .

+6
source

@Sorskoot , . , ( ):

(, )

var s = Windows.UI.ViewManagement.StatusBar.getForCurrentView();
s.showAsync(); 

,

// THIS IS WRONG
s.backgroundColor = 'red';
s.backgroundColor = '#A65959';

, : 0x800a13ec - JavaScript runtime error: Could not convert object to struct: object missing expected property 'a'

, s.backgroundColor   HTML, WinRT, "" WinRT, HTML/JS.

(). bg . 1.0, .

TL; DR;

// THIS IS RIGHT
s.backgroundOpacity = 0.99; 
s.backgroundColor = Windows.UI.ColorHelper.fromArgb(255, 0xA6, 0x59, 0x59);
s.foregroundColor = Windows.UI.Colors.lightGray;

WinRT. , 0-255 . s.backgroundOpacity float in range [0..1] >:o

Windows.UI.Colors, mind camelCasing (, lightGray), HTML/JS)

+1

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


All Articles