一切都很完美。 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!