在許多Windows Phone 7應用程序中,應用程序欄默認爲隱藏狀態,當您按住屏幕上的按鈕時,應用程序欄將變爲可見。由於許多WP7應用程序都有這種行爲,所以我想知道,是否有與ApplicationBar的這種行爲的內置支持,以及如何使用它?WP7 - show hide應用程序欄
3
A
回答
6
您可以使用toolkit中的手勢服務來檢測Hold
事件。
例如。
如果你有一個頁面上此XAML:
<TextBlock TextWrapping="Wrap" Text="lorem ipsum ...">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Hold="TapAndHold" />
</toolkit:GestureService.GestureListener>
</TextBlock>
和事件處理程序如下:
private void TapAndHold(object sender, GestureEventArgs e)
{
this.ApplicationBar.IsVisible = !this.ApplicationBar.IsVisible;
}
然後按住該文本塊的任何地方將切換應用程序任務欄的顯示。
如果您希望切換用戶在頁面上的任意位置輕敲並保持,則可以將手勢監聽器附加到頁面的根對象。例如
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Hold="TapAndHold" />
</toolkit:GestureService.GestureListener>
的
1
使用當前頁面的ApplicationBar屬性並相應地切換IsVisible屬性以顯示/隱藏ApplicationBar。 ApplicationBar由操作系統處理,因此用於顯示和隱藏它的動畫將爲您處理。
相關問題
- 1. Hide&Show右側欄
- 2. WP7其他應用程序欄?
- 3. jquery show hide division
- 4. Hide/Show DataTemplate
- 5. javascript hide show
- 6. jquery hide show
- 7. hide show menu getElementsByClassName
- 8. IE6 show hide divs
- 9. onmousedown hide/show div
- 10. jQuery .show().hide()不起作用
- 11. wxPython:使用Show()和Hide()
- 12. Angular hide show not working
- 13. show hide image inside div
- 14. jquery onclick hide/show div
- 15. Javascript:Ajax和Show/Hide Div
- 16. jQuery Modal + .show()和.hide()
- 17. Show and Hide Div onMouseOver
- 18. 以編程方式顯示應用程序欄菜單(wp7)
- 19. PHP會話與jQuery show()/ hide()
- 20. 路由 - Ng -hide,Ng-show AngularJS
- 21. JQuery if/else with show/hide
- 22. jQuery .show()/ .hide()保持閃爍
- 23. jQuery Show/Hide on Checkbox Not Working
- 24. jquery hide show輸入對象
- 25. jquery hide/show or condiiton failing
- 26. C#.net Winform -Multiple forms show&hide
- 27. Jquery show hide不工作
- 28. JQuery show hide div鏈接
- 29. jQuery show/hide/mouseenter問題
- 30. Coldfusion查詢show hide div
可能重複的[Windows Phone 7的隱藏應用程序欄(http://stackoverflow.com/questions/4116311/windows-phone-7-hiding-the-application-bar) – 2011-01-14 06:13:28