如果我离开应用程序(暂停)并返回内部,Windows Phone 8.1 WinJS AppBar就会消失

时间:2014-06-20 09:20:26

标签: winjs windows-phone-8.1 appbar

一切都很完美。 appbar仅显示在主页中,但如果我退出应用程序而不关闭并再次打开它,它将消失appbar

home.js

WinJS.UI.Pages.define("/pages/home.html", {
    ready: function (element, options) {
    appBar = document.getElementById("createAppBar").winControl;
        appBar.getCommandById("cmdSettings").addEventListener("click", doClickSettings, false);
        appBar.getCommandById("cmdCalibrate").addEventListener("click", doClickCalibrate, false);
        appBar.getCommandById("cmdShare").addEventListener("click", doClickShare, false);
        appBar.getCommandById("cmdEdit").addEventListener("click", doClickCamera, false);
        getLoc();

    }});
...

home.html

<div id="createAppBar" data-win-control="WinJS.UI.AppBar" data-win-options="{closedDisplayMode:'minimal'}">
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdSettings',label:'Ajustes',icon:'settings',tooltip:'Ajustes'}"></button>
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdCalibrate',label:'Calibrar',icon:'fourbars',tooltip:'Calibrar'}"></button>
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdShare',label:'Compartir',icon:'like',tooltip:'Corre la voz'}"></button>
<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdEdit',label:'about',icon:'like',tooltip:'Corre la voz'}"></button>
<!--<button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cmdCamera',label:'Camera',icon:'camera',section:'selection',tooltip:'Take a picture'}"></button>-->

有人能帮助我吗? Tnx in adv!

1 个答案:

答案 0 :(得分:0)

看起来它是WinJS中的一个错误。

https://github.com/winjs/winjs/issues/140