本文介绍了有关appbar.sticky的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我的appbar使用了sticky = true。这使得应用程序没有采取"点击"要取消appbar的事件,我想让我的appbar与"开始"菜单的行为相同。 

In my app, I was using sticky = true for my appbar. This makes the app not taking the "tap" event to dismiss the appbar, I would like to make my appbar to behave the same as the Start menu. 




所以我将appbar改为sticky = false。这解决了为点击事件解雇appbar的问题,但引入了一个新问题。当显示appbar时,如果用户右键单击listview项,它将关闭appbar并且不会选择该项。
用户需要再次右键单击该项目以选择它,然后再选择"选择"项。 appbar将显示。在"开始"菜单中,右键单击以在显示appbar时选择一个磁贴,不会关闭appbar,也会更新appbar按钮。 

So I changed my appbar to be sticky = false. This solves the problem of dismissing appbar for tap event, but introduced a new problem. When the appbar is shown, if user right-click on a listview item, it will dismiss the appbar and the item will not be selected. The user need to right click on the item again to select it and then the "selection" appbar will show. In Start Menu, right-click to select a tile when appbar is shown will NOT dismiss the appbar and it also updates the appbar buttons. 




那么,您能否建议我如何实现与"开始"菜单中相同的appbar行为?

So, could you please suggest how I can achieve the same appbar behaviour as it in Start Menu?




重新启动开始菜单的步骤:

1。通过右键单击或边缘滑动来显示appbar

1. make appbar show by right-click or edge swipping

2。点按屏幕(不在图块上),appbar 消失

2. tap the screen (not on tile), appbar disappears

3。重复1

4。点击屏幕(不在瓷砖上),appbar 保持

4. click on the screen (not on tile), appbar stays

5。右键单击以选择图块,appbar 更新

5. right click to select a tile, appbar updates




在我的应用程序中 sticky = true

1。通过右键单击或边缘滑动来显示appbar

1. make appbar show by right-click or edge swipping

2。点按屏幕(不在图块上),appbar  逗留

2. tap the screen (not on tile), appbar stays

3。点击屏幕(不在瓷砖上),appbar 保持

3. click on the screen (not on tile), appbar stays

4。右键单击以选择图块,appbar  更新

4. right click to select a tile, appbar updates

<div id="myAppBar" class="myAppBar" data-win-control="WinJS.UI.AppBar" aria-label="Command Bar"
        data-win-options="{placement:'bottom', sticky:true}">
</div>




在我的应用程序中使用  sticky = false

In my application with sticky = false

1。通过右键单击或边缘滑动来显示appbar

1. make appbar show by right-click or edge swipping

2。点按屏幕(不在图块上),appbar  消失

2. tap the screen (not on tile), appbar disappears

3。重复1

4。点击屏幕(不在平铺上),appbar  消失

4. click on the screen (not on tile), appbar disappears

5。右键单击以选择图块,appbar  消失并平铺未选中

5. right click to select a tile, appbar disappears AND tile NOT selected

6.右键单击以选择图块,  appbar  显示AND tile选中

6. right click to select a tile, appbar shows AND tile selected

<div id="myAppBar" class="myAppBar" data-win-control="WinJS.UI.AppBar" aria-label="Command Bar"
        data-win-options="{placement:'bottom', sticky:false}">
</div>

我的ListView代码:

Code for my ListView:

<div id="myItemList" class="myItemList" data-win-control="WinJS.UI.ListView"
                data-win-options="{layout: {type: WinJS.UI.GridLayout, groupHeaderPosition: 'top'}}"
                aria-label="Collections">
</div>





WinJS.UI.setOptions(myItemListControl, {
                itemDataSource: myItemList.dataSource,
                itemTemplate: listItemTemplateRenderer,
                groupDataSource: null,
                groupRenderer: null,
                selectionMode: 'single',
                oniteminvoked: itemInvoked,
                onselectionchanged: itemSelectionChanged
});

Louis





$
b $ b












推荐答案


这篇关于有关appbar.sticky的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 14:09