屏幕右侧的应用程序栏按钮Windows 8 metro风格的应用程序

时间:2012-09-08 12:38:52

标签: windows-8

我正在使用html,javascript和css开发metro风格的Windows 8应用程序。

我在我的应用程序底部使用app bar。以下是html代码。

<div id="appbarbottom" data-win-control="WinJS.UI.AppBar" data-win-options="{layout:'custom',placement:'bottom'}">
    <button id="playerBut" data-win-control="WinJS.UI.AppBarCommand" data-win-options="{section:'global',label:'Player', icon:'placeholder',type:'flyout',flyout:sportsFlyout}" type="button"></button>

</div>

我在官方文件中说,section:'global'会将按钮设为右侧。我这样做但是没有效果。

我曾尝试使用section:'selection',但仍然按钮位于左侧

我已经寻找替代解决方案,但每个人都说同样的事情,所以我怎样才能实现我的目标。请给我有用的帮助。

谢谢。

1 个答案:

答案 0 :(得分:1)

我已从'layout:custom'

中删除了data-win-options="{layout:'custom',placement:'bottom'} data-win-control="WinJS.UI.AppBar"

,它解决了我的问题。

我几乎浪费了4个小时。

我希望这会对别人有所帮助。

感谢。